phetsims / expression-exchange

"Expression Exchange" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
2 stars 2 forks source link

Automated Testing Sim Error (11/15/2016 9:58 AM) #44

Closed phet-steele closed 7 years ago

phet-steele commented 7 years ago
Error: Assertion failed: x should be a finite number
    at window.assertions.assertFunction (http://phettest.colorado.edu/assert/js/assert.js:23:13)
    at VariableCoinTermNode.setX (http://phettest.colorado.edu/scenery/js/nodes/Node.js:1707:17)
    at VariableCoinTermNode.set x [as x] (http://phettest.colorado.edu/scenery/js/nodes/Node.js:1712:27)
    at Array.handlePositionChanged (http://phettest.colorado.edu/expression-exchange/js/common/view/AbstractCoinTermNode.js:128:14)
    at Emitter.emit2 (http://phettest.colorado.edu/axon/js/Emitter.js:139:49)
    at Property._notifyObservers (http://phettest.colorado.edu/axon/js/Property.js:170:29)
    at Property._setAndNotifyObservers (http://phettest.colorado.edu/axon/js/Property.js:158:14)
    at Property.set (http://phettest.colorado.edu/axon/js/Property.js:126:16)
    at Object. (http://phettest.colorado.edu/expression-exchange/js/common/model/CoinTerm.js:151:33)
    at TWEEN.Tween.update (http://phettest.colorado.edu/sherpa/lib/Tween-r12.js:317:25)
jonathanolson commented 7 years ago

Obligatory "This failure shows up reliably in automated testing, so I haven't been able to fix any usage that triggers recently-added Scenery assertions, or check it for any failures related to recent Scenery changes."

samreid commented 7 years ago

I saw this again today:

expression-exchange
Uncaught Error: Assertion failed: x should be a finite number
Error: Assertion failed: x should be a finite number
    at window.assertions.assertFunction (http://localhost/assert/js/assert.js:21:13)
    at VariableCoinTermNode.setX (http://localhost/scenery/js/nodes/Node.js?bust=1480917756882:1823:17)
    at VariableCoinTermNode.set x [as x] (http://localhost/scenery/js/nodes/Node.js?bust=1480917756882:1828:27)
    at Array.handlePositionChanged (http://localhost/expression-exchange/js/common/view/AbstractCoinTermNode.js?bust=1480917756882:128:14)
    at Emitter.emit2 (http://localhost/axon/js/Emitter.js?bust=1480917756882:139:49)
    at Property._notifyObservers (http://localhost/axon/js/Property.js?bust=1480917756882:170:29)
    at Property._setAndNotifyObservers (http://localhost/axon/js/Property.js?bust=1480917756882:158:14)
    at Property.set (http://localhost/axon/js/Property.js?bust=1480917756882:126:16)
    at Object. (http://localhost/expression-exchange/js/common/model/CoinTerm.js?bust=1480917756882:151:33)
    at TWEEN.Tween.update (http://localhost/sherpa/lib/Tween-r12.js:317:25)
jbphet commented 7 years ago

This problem appears to arise when CoinTerm.travelToDestination( destination ) is called and the coin term is already at the specified location. In this case, the TWEEN animation ends up trying to set a non-numeric position value. I'm not sure exactly why this is - it seems like an issue inside of TWEEN - but adding an if clause that doesn't create the TWEEN animation if the coin term is already at the destination seems like a good thing to do in general, so that's what I've done. After making this change, I did roughly 10 minutes of fuzz testing and did not encounter the problem, so I think this is resolved. Closing.