Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CT: Assertion failed: countingObject already removed from sum #25

Open
pixelzoom opened this issue Jan 13, 2023 · 5 comments
Open

CT: Assertion failed: countingObject already removed from sum #25

pixelzoom opened this issue Jan 13, 2023 · 5 comments

Comments

@pixelzoom
Copy link
Contributor

Possibly similar to #14 ...

While trying to reproduce #14 on 1/5/2023, I hit this assertion failure in master with http://localhost:8080/number-play/number-play_en.html?brand=phet&screens=4&ea&fuzz&fuzzPointers=2&supportsPanAndZoom=false:

assert.js:28 Uncaught Error: Assertion failed: countingObject already removed from sum
    at window.assertions.assertFunction (assert.js:28:13)
    at CountingPlayArea.sendCountingObjectToCreatorNode (CountingPlayArea.ts:273:15)
    at Object.removeCountingObjectListener (LabScreenView.ts:340:33)
    at DraggableTenFrameNode.ts:97:15
    at TinyEmitter.emit (TinyEmitter.ts:95:9)
    at Emitter.emit (Emitter.ts:125:22)
    at Proxy.pop (createObservableArray.ts:309:58)
    at Proxy.clear (createObservableArray.ts:394:47)
    at Object.dropListener (LabScreenView.ts:308:34)
    at DragListener.end [as _end] (DraggableTenFrameNode.ts:68:17)

Related code in DraggableTenFrameNode.ts, failure at line 97:

    tenFrame.countingObjects.addItemRemovedListener( countingObject => {
97    options.removeCountingObjectListener( countingObject );
    } );

Related code in CountingPlayArea.ts, failure at line 273:

  public sendCountingObjectToCreatorNode( countingObject: CountingObject ): void {
    assert && assert( this.countingObjects.lengthProperty.value > 0, 'countingObjects should exist in play area' );
    assert && assert( this.initialized, 'returnCountingObjectToBucket called before initialization' );

    // remove it from counting towards the sum and send it back to its origin. countingObjects aren't removed from the
    // playArea until they get back to the bucket, but we don't want them to count towards the sum while they're on
    // their way to the bucket.
273    assert && assert( countingObject.includeInSumProperty.value, 'countingObject already removed from sum' );
@pixelzoom
Copy link
Contributor Author

I see this same failure in CT a couple of times today for number-compare, in LabScreenView:

number-compare : pan-and-zoom-fuzz : unbuilt
https://bayes.colorado.edu/continuous-testing/ct-snapshots/1673509769946/number-compare/number-compare_en.html?continuousTest=%7B%22test%22%3A%5B%22number-compare%22%2C%22pan-and-zoom-fuzz%22%2C%22unbuilt%22%5D%2C%22snapshotName%22%3A%22snapshot-1673509769946%22%2C%22timestamp%22%3A1673520120685%7D&brand=phet&ea&fuzz&fuzzPointers=2&memoryLimit=1000&supportsPanAndZoom=true
Query: brand=phet&ea&fuzz&fuzzPointers=2&memoryLimit=1000&supportsPanAndZoom=true
Uncaught Error: Assertion failed: countingObject already removed from sum
Error: Assertion failed: countingObject already removed from sum
at window.assertions.assertFunction (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1673509769946/assert/js/assert.js:28:13)
at assert (CountingPlayArea.ts:275:14)
at sendCountingObjectToCreatorNode (LabScreenView.ts:340:32)
at removeCountingObjectListener (DraggableTenFrameNode.ts:100:14)
at listener (TinyEmitter.ts:95:8)
at emit (Emitter.ts:125:21)
at emit (createObservableArray.ts:309:57)
at pop (createObservableArray.ts:394:46)
at clear (LabScreenView.ts:308:33)
at dropListener (DraggableTenFrameNode.ts:75:16)
id: Bayes Puppeteer
Snapshot from 1/12/2023, 12:49:29 AM

@pixelzoom
Copy link
Contributor Author

@chrisklus FYI... Adding blocks-sim-publication label to this issue. While its true that this issue is rare and does not need to be resolved before publication, we do need to ensure that the sim does not crash when the assertion condition is violated.

@pixelzoom
Copy link
Contributor Author

In the above commit, I added a workaround to ensure that the sim does not crash if this assertion is violated. If the assertion is violated, then the body of CountingPlayArea sendCountingObjectToCreatorNode is short-circuited.

@chrisklus please review. If this is acceptable, then please remove label "ready-for-review", add "status:deferred", and unassign. We will consider looking at the root cause of the assertion failure in a future release.

@chrisklus
Copy link
Contributor

Thanks @pixelzoom, workaround looks good to me. Adding status:deferred label.

@chrisklus
Copy link
Contributor

For #72

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants