phetsims / bending-light

"Bending Light" is an educational simulation in HTML5, by PhET Interactive Simulations.
http://phet.colorado.edu/en/simulation/bending-light
GNU General Public License v3.0
8 stars 8 forks source link

CT: Attempted to removeChild with a node that was not a child. #413

Closed pixelzoom closed 1 year ago

pixelzoom commented 1 year ago

This started in CT on 1/18/2023 @ 5:18:26 PM has been occurring on every CT cycle since.

bending-light : fuzz : unbuilt : assertSlow
https://bayes.colorado.edu/continuous-testing/ct-snapshots/1674216113796/bending-light/bending-light_en.html?continuousTest=%7B%22test%22%3A%5B%22bending-light%22%2C%22fuzz%22%2C%22unbuilt%22%2C%22assertSlow%22%5D%2C%22snapshotName%22%3A%22snapshot-1674216113796%22%2C%22timestamp%22%3A1674226032005%7D&brand=phet&eall&fuzz&memoryLimit=1000
Query: brand=phet&eall&fuzz&memoryLimit=1000
Uncaught Error: Assertion failed: Attempted to removeChild with a node that was not a child.
Error: Assertion failed: Attempted to removeChild with a node that was not a child.
at window.assertions.assertFunction (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1674216113796/assert/js/assert.js:28:13)
at assert (Node.ts:917:14)
at removeChild (PrismsScreenView.ts:164:17)
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 (PrismsModel.ts:431:23)
at clear (PrismNode.ts:124:18)
at listener (ReadOnlyProperty.ts:407:4)
id: Bayes Puppeteer
Snapshot from 1/20/2023, 5:01:53 AM

----------------------------------

bending-light : multitouch-fuzz : unbuilt
https://bayes.colorado.edu/continuous-testing/ct-snapshots/1674216113796/bending-light/bending-light_en.html?continuousTest=%7B%22test%22%3A%5B%22bending-light%22%2C%22multitouch-fuzz%22%2C%22unbuilt%22%5D%2C%22snapshotName%22%3A%22snapshot-1674216113796%22%2C%22timestamp%22%3A1674219272035%7D&brand=phet&ea&fuzz&fuzzPointers=2&memoryLimit=1000&supportsPanAndZoom=false
Query: brand=phet&ea&fuzz&fuzzPointers=2&memoryLimit=1000&supportsPanAndZoom=false
Uncaught Error: Assertion failed: Attempted to removeChild with a node that was not a child.
Error: Assertion failed: Attempted to removeChild with a node that was not a child.
at window.assertions.assertFunction (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1674216113796/assert/js/assert.js:28:13)
at assert (Node.ts:917:14)
at removeChild (PrismsScreenView.ts:164:17)
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 (PrismsModel.ts:431:23)
at clear (PrismNode.ts:124:18)
at listener (ReadOnlyProperty.ts:407:4)
id: Bayes Puppeteer
Snapshot from 1/20/2023, 5:01:53 AM

----------------------------------

bending-light : pan-and-zoom-fuzz : unbuilt
https://bayes.colorado.edu/continuous-testing/ct-snapshots/1674216113796/bending-light/bending-light_en.html?continuousTest=%7B%22test%22%3A%5B%22bending-light%22%2C%22pan-and-zoom-fuzz%22%2C%22unbuilt%22%5D%2C%22snapshotName%22%3A%22snapshot-1674216113796%22%2C%22timestamp%22%3A1674218915065%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: Attempted to removeChild with a node that was not a child.
Error: Assertion failed: Attempted to removeChild with a node that was not a child.
at window.assertions.assertFunction (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1674216113796/assert/js/assert.js:28:13)
at assert (Node.ts:917:14)
at removeChild (PrismsScreenView.ts:164:17)
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 (PrismsModel.ts:431:23)
at clear (PrismsModel.ts:101:11)
at callback (Multilink.ts:111:10)
id: Bayes Puppeteer
Snapshot from 1/20/2023, 5:01:53 AM
pixelzoom commented 1 year ago

To reproduce manually:

  1. Start the sim, go to Prisims screen.
  2. Drag out a prism from the toolbox.
  3. Turn the light on.
  4. Check the "Normal" checkbox. The sim should now look something like the screenshot below.
  5. Move the "Index of Refraction" slider thumb. The assertion will fail.
screenshot_2163
jessegreenberg commented 1 year ago

A Node is being removed as a child after it has been disposed. When a Node is disposed it gets detached from the scene graph so the removeChild call shouldn't be needed. I think this started happening in ac3e7418 when super.dispose was added to IntersectionNode.dispose.

Committed above and not seeing it anymore from the steps in https://github.com/phetsims/bending-light/issues/413#issuecomment-1398563720

samreid commented 1 year ago

That looks correct to me, thanks so much! Closing.