Closed pixelzoom closed 3 years ago
I'm also wondering why this error is not showing up in CT. I added phetioDesigned: true
on 7/6/21 @ 6:32pm, and CT has run 6 test cycles since then. Is this test actually being run by CT?
I'll take a look!
I pulled all, and then ran:
Then I parsed the horrible json-ish output by replacing Expected:
and , actual:
with newlines, and I got this:
naturalSelection.introScreen.model.bunnyCollection.bunnyGroup.archetype._data.initialState differs:
{"_private":{"cumulativeHopTime":0,"cumulativeRestTime":0,"hopDelta":{"x":15.22165343022406,"y":48.54714899884378,"z":12.684829323916581},"hopStartPosition":{"x":60.532144260044134,"y":-78.9058606222451,"z":181.64120906663234},"hopTime":0.4357117786067223,"restTime":2.9807053366829397},"age":0,"father":null,"generation":0,"isAlive":true,"mother":null}
{"father":null,"mother":null,"generation":0,"isAlive":true,"age":0,"_private":{"restTime":2.7018245396764424,"hopTime":0.37145791805325357,"cumulativeRestTime":0,"cumulativeHopTime":0,"hopDelta":{"x":-16.780560589326512,"y":32.560992241519045,"z":-9.734973426342497},"hopStartPosition":{"x":-59.77427630950419,"y":-62.26770743671871,"z":206.59843884492193}}}
naturalSelection.introScreen.model.bunnyCollection.bunnyGroup.archetype.positionProperty._data.initialState differs:
{"units":null,"validValues":null,"value":{"x":60.532144260044134,"y":-78.9058606222451,"z":181.64120906663234}}
{"value":{"x":-59.77427630950419,"y":-62.26770743671871,"z":206.59843884492193},"validValues":null,"units":null}
naturalSelection.introScreen.model.bunnyCollection.bunnyGroup.archetype.xDirectionProperty._data.initialState differs:
{"units":null,"validValues":["LEFT","RIGHT"],"value":"RIGHT"}
{"value":"LEFT","validValues":["LEFT","RIGHT"],"units":null}
naturalSelection.introScreen.model.bunnyCollection.bunnyGroup.bunny_0._data.initialState differs:
{"_private":{"cumulativeHopTime":0,"cumulativeRestTime":0,"hopDelta":{"x":-16.17943842560941,"y":49.17372834079743,"z":-6.723558180699183},"hopStartPosition":{"x":242.34395155461738,"y":-22.852816208966374,"z":265.72077568655044},"hopTime":0.4105757432869891,"restTime":1.733928075687837},"age":0,"father":null,"generation":0,"isAlive":true,"mother":null}
{"father":null,"mother":null,"generation":0,"isAlive":true,"age":0,"_private":{"restTime":1.3926442195784587,"hopTime":0.3664566424200951,"cumulativeRestTime":0,"cumulativeHopTime":0,"hopDelta":{"x":-13.345672919838014,"y":32.62236026723778,"z":10.377831239320455},"hopStartPosition":{"x":-25.143955421198655,"y":-77.12669201353901,"z":184.30996197969148}}}
naturalSelection.introScreen.model.bunnyCollection.bunnyGroup.bunny_0.positionProperty._data.initialState differs:
{"units":null,"validValues":null,"value":{"x":242.34395155461738,"y":-22.852816208966374,"z":265.72077568655044}}
{"value":{"x":-25.143955421198655,"y":-77.12669201353901,"z":184.30996197969148},"validValues":null,"units":null}
naturalSelection.introScreen.model.wolfCollection.wolfGroup.archetype._data.initialState differs:
{"_private":{"speed":158.03332201218853}}
{"_private":{"speed":170.958872349204}}
naturalSelection.introScreen.model.wolfCollection.wolfGroup.archetype.positionProperty._data.initialState differs:
{"units":null,"validValues":null,"value":{"x":-125.23828095416042,"y":-58.25886076740691,"z":212.61170884888963}}
{"value":{"x":-71.00571623876567,"y":-54.996686657376905,"z":217.50497001393464},"validValues":null,"units":null}
naturalSelection.introScreen.model.wolfCollection.wolfGroup.archetype.xDirectionProperty._data.initialState differs:
{"units":null,"validValues":["LEFT","RIGHT"],"value":"RIGHT"}
{"value":"LEFT","validValues":["LEFT","RIGHT"],"units":null}
naturalSelection.labScreen.model.bunnyCollection.bunnyGroup.archetype._data.initialState differs:
{"_private":{"cumulativeHopTime":0,"cumulativeRestTime":0,"hopDelta":{"x":15.026184316645049,"y":41.21830940413096,"z":-10.247822414681844},"hopStartPosition":{"x":-204.4362527095605,"y":-5.374966999287115,"z":291.9375495010693},"hopTime":0.40510814444208754,"restTime":1.926434494549918},"age":0,"father":null,"generation":0,"isAlive":true,"mother":null}
{"father":null,"mother":null,"generation":0,"isAlive":true,"age":0,"_private":{"restTime":2.806020437221202,"hopTime":0.43276774069209145,"cumulativeRestTime":0,"cumulativeHopTime":0,"hopDelta":{"x":17.63867517890751,"y":49.090402481554236,"z":-8.40494483084945},"hopStartPosition":{"x":103.34636259832627,"y":-50.670095616209345,"z":223.994856575686}}}
naturalSelection.labScreen.model.bunnyCollection.bunnyGroup.archetype.positionProperty._data.initialState differs:
{"units":null,"validValues":null,"value":{"x":-204.4362527095605,"y":-5.374966999287115,"z":291.9375495010693}}
{"value":{"x":103.34636259832627,"y":-50.670095616209345,"z":223.994856575686},"validValues":null,"units":null}
naturalSelection.labScreen.model.bunnyCollection.bunnyGroup.bunny_0._data.initialState differs:
{"_private":{"cumulativeHopTime":0,"cumulativeRestTime":0,"hopDelta":{"x":-14.756223648971094,"y":47.44263166490198,"z":7.335895397398229},"hopStartPosition":{"x":-225.75124546357583,"y":-45.09699228876825,"z":232.35451156684763},"hopTime":0.4596950485642879,"restTime":1.9745883803442004},"age":0,"father":null,"generation":0,"isAlive":true,"mother":null}
{"father":null,"mother":null,"generation":0,"isAlive":true,"age":0,"_private":{"restTime":1.2176901511580194,"hopTime":0.32057176331792103,"cumulativeRestTime":0,"cumulativeHopTime":0,"hopDelta":{"x":15.733891888178658,"y":39.70201648770933,"z":-2.475136734138804},"hopStartPosition":{"x":71.37289231164004,"y":-78.85318525008829,"z":181.72022212486758}}}
naturalSelection.labScreen.model.bunnyCollection.bunnyGroup.bunny_0.positionProperty._data.initialState differs:
{"units":null,"validValues":null,"value":{"x":-225.75124546357583,"y":-45.09699228876825,"z":232.35451156684763}}
{"value":{"x":71.37289231164004,"y":-78.85318525008829,"z":181.72022212486758},"validValues":null,"units":null}
naturalSelection.labScreen.model.bunnyCollection.bunnyGroup.bunny_0.xDirectionProperty._data.initialState differs:
{"units":null,"validValues":["LEFT","RIGHT"],"value":"LEFT"}
{"value":"RIGHT","validValues":["LEFT","RIGHT"],"units":null}
naturalSelection.labScreen.model.wolfCollection.wolfGroup.archetype._data.initialState differs:
{"_private":{"speed":161.4491569500465}}
{"_private":{"speed":189.15268002265276}}
naturalSelection.labScreen.model.wolfCollection.wolfGroup.archetype.positionProperty._data.initialState differs:
{"units":null,"validValues":null,"value":{"x":-260.3667461546996,"y":-13.013580371909939,"z":280.4796294421351}}
{"value":{"x":178.88171902020912,"y":-9.68208837704151,"z":285.47686743443774},"validValues":null,"units":null}
All of the above look to be values of PhET-iO element's initial state that are based on a seeded random, and so are different between runtimes. This seems like something to try to manage, but I'm not sure off the top of my head the best solution. I'll create a general issue.
Any idea why this is not showing up as an error in CT?
Hmm, not totally sure. Looks like it isn't run very often, but I guess it should have failed when it ran that one time:
After the above formatting commits, this is what the assertion message now looks like off the bat:
I found https://github.com/phetsims/phet-io/issues/1765, noting that the generated API file is consistent as it pertains to randomness. From this I don't feel like this needs to block publication. The issue is in our ability to maintain master and prevent changes from occurring that change the API on master.
OK, I think I understand why this doesn't need to be blocking -- it's relevant to master, not a release branch.
But if these types of errors persist, how will we identify real errors? And will these types of errors occur in CT?
This is certainly something to fix, and to not let linger.
Any idea why this is not showing up as an error in CT?
I poked around and tried to see if CT was seeding anything, purposefully or accidentally. I couldn't find anything. More investigation to be done in https://github.com/phetsims/phet-io/issues/1799
My guess is that something is broken with this test for NS, and it is breaking something in CT, because this feels unlikely to be probabilistically possible:
I recommend closing this issue after @pixelzoom notes that locally this link will not fail:
And changing the randomSeed to anything else will cause an assertion error.
We will continue the CT trouble over in https://github.com/phetsims/phet-io/issues/1799.
And changing the randomSeed to anything else will cause an assertion error.
I can use any number for randomSeed
and it does not cause an error. For example http://localhost/~cmalley/GitHub/natural-selection/natural-selection_en.html?brand=phet-io&phetioStandalone&phetioCompareAPI&randomSeed=789&ea&debugger
You've also duplicated the API-generation seed "12345" in two places: generatePhetioMacroAPI.js, listContinuousTests.js. This should be factored out, not duplicated in string literals.
Back to @zepumph.
I can use any number for randomSeed and it does not cause an error. For example http://localhost/~cmalley/GitHub/natural-selection/natural-selection_en.html?brand=phet-io&phetioStandalone&phetioCompareAPI&randomSeed=789&ea&debugger
With that link I get
I see that I am pushed, pulled, and entirely on master.
You've also duplicated the API-generation seed "12345" in two places: generatePhetioMacroAPI.js, listContinuousTests.js. This should be factored out, not duplicated in string literals.
Yes, it is duplicated in more than just those two spots. I cannot think of a place to factor it out to, see https://github.com/phetsims/phet-io/issues/1798#issuecomment-877845936 for discussion. Conclusion still TBD.
Hmm.... It seems to be working as expected now. Maybe I didn't have something pulled, or had a cacheing problem. Sorry for the reassignment.
Closing - because this pertains to master, it does not need to be verified by QA for phetsims/qa#662.
For phetsims/qa#662
In https://github.com/phetsims/natural-selection/issues/294, I followed all of the steps in https://github.com/phetsims/phet-io/blob/master/doc/phet-io-instrumentation-technical-guide.md#post-publication-steps for setting up
phetioDesigned: true
. Everything is commited and pushed.When I run NS (master) in Studio with
phetioCompareAPI
, it's failing with:The json part of the console output is way too long to be examined manually.
I've tried re-running
grunt generate-phet-io-api
, and no changes are generated, so there's nothing for me to diff.@samreid @zepumph suggestions on how to proceed?