phetsims / build-an-atom

"Build an Atom" is an educational simulation in HTML5, by PhET Interactive Simulations.
http://phet.colorado.edu/en/simulation/build-an-atom
GNU General Public License v3.0
11 stars 10 forks source link

CT should not be called if disposed #203

Closed KatieWoe closed 5 years ago

KatieWoe commented 5 years ago
Query: brand=phet&ea&fuzzBoard&a11y&memoryLimit=1000
Uncaught Error: Assertion failed: should not be called if disposed
Error: Assertion failed: should not be called if disposed
    at window.assertions.assertFunction (https://bayes.colorado.edu/continuous-testing/snapshot-1561528310946/assert/js/assert.js:22:13)
    at TinyEmitter.emit (https://bayes.colorado.edu/continuous-testing/snapshot-1561528310946/axon/js/TinyEmitter.js?bust=1561549596721:50:17)
    at BooleanProperty._notifyListeners (https://bayes.colorado.edu/continuous-testing/snapshot-1561528310946/axon/js/Property.js?bust=1561549596721:247:27)
    at BooleanProperty.set (https://bayes.colorado.edu/continuous-testing/snapshot-1561528310946/axon/js/Property.js?bust=1561549596721:160:14)
    at BooleanProperty.set value [as value] (https://bayes.colorado.edu/continuous-testing/snapshot-1561528310946/axon/js/Property.js?bust=1561549596721:316:34)
    at PressListener.interrupt (https://bayes.colorado.edu/continuous-testing/snapshot-1561528310946/scenery/js/listeners/PressListener.js?bust=1561549596721:429:43)
    at TextPushButton.interruptInput (https://bayes.colorado.edu/continuous-testing/snapshot-1561528310946/scenery/js/nodes/Node.js?bust=1561549596721:1936:40)
    at TextPushButton.blur (https://bayes.colorado.edu/continuous-testing/snapshot-1561528310946/scenery/js/accessibility/Accessibility.js?bust=1561549596721:531:18)
    at Function.set focus [as focus] (https://bayes.colorado.edu/continuous-testing/snapshot-1561528310946/scenery/js/display/Display.js?bust=1561549596721:1730:23)
    at Object.blur (https://bayes.colorado.edu/continuous-testing/snapshot-1561528310946/scenery/js/input/A11yPointer.js?bust=1561549596721:65:33)
id: Bayes Chrome
Approximately 6/25/2019, 11:51:50 PM
build-an-atom : phet-io-tests : assert
9 out of 9 tests passed. 0 failed.

Approximately 6/25/2019, 11:51:50 PM
build-an-atom : phet-io-tests : no-assert
9 out of 9 tests passed. 0 failed.

Approximately 6/25/2019, 11:51:50 PM
jbphet commented 5 years ago

This issue happened three times, and hasn't happened since. The root of the stack is in A11yPointer.js in the 'blur' function, so this seems like this is accessibility related. I looked at that file and some others that are related and didn't see any recent changes. I also fuzz tested locally for ~20 minutes without hitting this issue, so I'm not sure where to go with it from here.

@jessegreenberg - do you have any immediate insights? If not, I'd suggest assigning it back to QA to watch and see if it recurs before we spend any more time on it.

jessegreenberg commented 5 years ago

Thanks, this is a11y related, I will take a look. I was able to hit it after running the sim with ?fuzzBoard&a11y, but it still took a while (~4 minutes of fuzzing in the background).

jessegreenberg commented 5 years ago

The trace looks different than what was reported when I hit the issue:

image

jessegreenberg commented 5 years ago

I found that this can be reproduced just by clicking the "Next" button with a spacebar in the game screen.

jessegreenberg commented 5 years ago

This has likely always been an issue but the assertion was added somewhat recently for https://github.com/phetsims/axon/issues/242. From that issue there is a comment that mentiones

pointed out that this seems to happen when clicking a button causes it to dispose itself.

Which is exactly what is happening here.

jessegreenberg commented 5 years ago

There are two ways to hit this currently - 1) The PressListener can be disposed before PressListener interrupt function is called internally by scenery because the button receives a blur event, and on blur interruptInput is called. 2) The PressListener can be disposed before the end of _a11yLooksPressedInterval when the button disposes itself and so we try to set the value of a11yClickingProperty after it has been disposed.

jessegreenberg commented 5 years ago

The buttons are working after the above commit, and I haven't seen the issue show up while running ?fuzzBoard. Ill check again after a few CT iterations and then close if it doesn't show up again.

jessegreenberg commented 5 years ago

Verified fixed, closing