phetsims / sun

User-interface components for PhET simulations, built on top of Scenery.
MIT License
4 stars 12 forks source link

CT random was called more times in the playback sim on startup #695

Closed KatieWoe closed 1 year ago

KatieWoe commented 3 years ago
sun : phet-io-mirror-inputs-fuzz : unbuilt
https://bayes.colorado.edu/continuous-testing/ct-snapshots/1618239924819/phet-io-wrappers/mirror-inputs/?sim=sun&phetioDebug&fuzz&wrapperContinuousTest=%7B%22test%22%3A%5B%22sun%22%2C%22phet-io-mirror-inputs-fuzz%22%2C%22unbuilt%22%5D%2C%22snapshotName%22%3A%22snapshot-1618239924819%22%2C%22timestamp%22%3A1618241054340%7D
Uncaught Error: Uncaught Error: Assertion failed: Random was called more times in the playback sim on startup, before: 18,0,0, after: 30,0,0
Error: Assertion failed: Random was called more times in the playback sim on startup, before: 18,0,0, after: 30,0,0
at window.assertions.assertFunction (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1618239924819/assert/js/assert.js:25:13)
at https://bayes.colorado.edu/continuous-testing/ct-snapshots/1618239924819/joist/js/Sim.js:980:27
id: Bayes Chrome
Snapshot from 4/12/2021, 9:05:24 AM
samreid commented 3 years ago

This is happening because the align box test in screen 2 calls for randomness in stepTimer.

samreid commented 3 years ago

I added a workaround in the commit. @zepumph can you please review and advise? It seems the long term solution would be to make sure the stepTimer is called the same number of times in the upstream and downstream sim, but I'm not sure how to do that and this seems to be the only place affected at the moment.

zepumph commented 1 year ago

This looks good to me. It seems like a lot of work to ensure the stepTimer synchronization, especially since we don't actively support playback. This feels just fine. Thank you! Closing