phetsims / number-line-integers

"Number Line: Integers" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
0 stars 4 forks source link

CT: Uncaught Error: Assertion failed: This Disposable has already been disposed, and cannot be disposed again #121

Closed jbphet closed 11 months ago

jbphet commented 11 months ago

A failure has popped up on CT. The message is "Uncaught Error: Assertion failed: This Disposable has already been disposed, and cannot be disposed again". I was able to reproduce it fairly quickly with local fuzz testing.

The line of code that is throwing this error was added two days ago in this commit. Assigning to the author of that commit for investigation.

marlitas commented 11 months ago

The dispose function is getting called multiple times in ColorizedReadoutNode in the temperature scene. This was causing the StringProperty attached to that node to call dispose multiple times even if it had already been disposed. The above commit checks to make sure the stringProperty hasn't been disposed yet before calling dispose. This was straightforward and should be ready to close.

marlitas commented 11 months ago

New error appearing:

number-line-integers : fuzz : unbuilt
http://128.138.93.172/continuous-testing/ct-snapshots/1701475273347/number-line-integers/number-line-integers_en.html?continuousTest=%7B%22test%22%3A%5B%22number-line-integers%22%2C%22fuzz%22%2C%22unbuilt%22%5D%2C%22snapshotName%22%3A%22snapshot-1701475273347%22%2C%22timestamp%22%3A1701475651313%7D&brand=phet&ea&fuzz
Query: brand=phet&ea&fuzz
Uncaught Error: Assertion failed: Cannot add a listener to a disposed TinyEmitter
Error: Assertion failed: Cannot add a listener to a disposed TinyEmitter
at window.assertions.assertFunction (http://128.138.93.172/continuous-testing/ct-snapshots/1701475273347/assert/js/assert.js:28:13)
at assert (TinyEmitter.ts:148:14)
at addListener (TinyProperty.ts:143:9)
at lazyLink (ReadOnlyProperty.ts:436:22)
at lazyLink (TinyForwardingProperty.ts:129:26)
at setTargetProperty (Text.ts:204:32)
at setStringProperty (Text.ts:207:81)
at (Node.ts:6337:21)
at mutate (Text.ts:134:17)
at mutate (Text.ts:124:9)
marlitas commented 11 months ago

I worked with @jonathanolson on addressing the memory leak associated with these errors, and also learned tons more about memory leaks for the future. Really cool!

I fuzzed and checked that the sim is working as expected and that memory leaks are gone. Closing!