Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CT: value should have typeof number, value=null #235

Closed
KatieWoe opened this issue Jul 5, 2022 · 5 comments
Closed

CT: value should have typeof number, value=null #235

KatieWoe opened this issue Jul 5, 2022 · 5 comments

Comments

@KatieWoe
Copy link
Contributor

KatieWoe commented Jul 5, 2022

The issue in CT is fairly long. Here is a part:

ph-scale : autofill-fuzz : unbuilt : query-parameters
https://bayes.colorado.edu/continuous-testing/ct-snapshots/1656941636348/ph-scale/ph-scale_en.html?continuousTest=%7B%22test%22%3A%5B%22ph-scale%22%2C%22autofill-fuzz%22%2C%22unbuilt%22%2C%22query-parameters%22%5D%2C%22snapshotName%22%3A%22snapshot-1656941636348%22%2C%22timestamp%22%3A1656943905041%7D&brand=phet&ea&fuzz&memoryLimit=1000&autoFill=false
Query: brand=phet&ea&fuzz&memoryLimit=1000&autoFill=false
Uncaught Error: Assertion failed: validation failed:
Property value not valid: value should have typeof number, value=null
prunedValidator:
[object Object]
Error: Assertion failed: validation failed:
at window.assertions.assertFunction (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1656941636348/assert/js/assert.js:28:13)
at assert (validate.ts:25:16)
at validate (ReadOnlyProperty.ts:176:33)
at listener (TinyEmitter.ts:92:8)
at emit (ReadOnlyProperty.ts:259:22)
at _notifyListeners (ReadOnlyProperty.ts:210:13)
at set (Property.ts:67:10)
at set (GraphIndicatorDragListener.js:85:21)
at _dragListener (PressListener.ts:527:9)
at call (DragListener.ts:308:35)
id: Bayes Puppeteer
Snapshot from 7/4/2022, 7:33:56 AM

----------------------------------

ph-scale : autofill-fuzz : unbuilt : query-parameters
https://bayes.colorado.edu/continuous-testing/ct-snapshots/1656941636348/ph-scale/ph-scale_en.html?continuousTest=%7B%22test%22%3A%5B%22ph-scale%22%2C%22autofill-fuzz%22%2C%22unbuilt%22%2C%22query-parameters%22%5D%2C%22snapshotName%22%3A%22snapshot-1656941636348%22%2C%22timestamp%22%3A1656950327422%7D&brand=phet&ea&fuzz&memoryLimit=1000&autoFill=false
Query: brand=phet&ea&fuzz&memoryLimit=1000&autoFill=false
Uncaught Error: Assertion failed: validation failed:
Property value not valid: value should have typeof number, value=null
prunedValidator:
[object Object]
Error: Assertion failed: validation failed:
at window.assertions.assertFunction (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1656941636348/assert/js/assert.js:28:13)
at assert (validate.ts:25:16)
at validate (ReadOnlyProperty.ts:176:33)
at listener (TinyEmitter.ts:92:8)
at emit (ReadOnlyProperty.ts:259:22)
at _notifyListeners (ReadOnlyProperty.ts:210:13)
at set (Property.ts:67:10)
at set (GraphIndicatorDragListener.js:85:21)
at _dragListener (PressListener.ts:527:9)
at call (DragListener.ts:308:35)
id: Bayes Puppeteer
Snapshot from 7/4/2022, 7:33:56 AM

----------------------------------

ph-scale : autofill-fuzz : unbuilt : query-parameters
https://bayes.colorado.edu/continuous-testing/ct-snapshots/1656941636348/ph-scale/ph-scale_en.html?continuousTest=%7B%22test%22%3A%5B%22ph-scale%22%2C%22autofill-fuzz%22%2C%22unbuilt%22%2C%22query-parameters%22%5D%2C%22snapshotName%22%3A%22snapshot-1656941636348%22%2C%22timestamp%22%3A1656956349707%7D&brand=phet&ea&fuzz&memoryLimit=1000&autoFill=false
Query: brand=phet&ea&fuzz&memoryLimit=1000&autoFill=false
Uncaught Error: Assertion failed: validation failed:
Property value not valid: value should have typeof number, value=null
prunedValidator:
[object Object]
Error: Assertion failed: validation failed:
at window.assertions.assertFunction (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1656941636348/assert/js/assert.js:28:13)
at assert (validate.ts:25:16)
at validate (ReadOnlyProperty.ts:176:33)
at listener (TinyEmitter.ts:92:8)
at emit (ReadOnlyProperty.ts:259:22)
at _notifyListeners (ReadOnlyProperty.ts:210:13)
at set (Property.ts:67:10)
at set (GraphIndicatorDragListener.js:85:21)
at _dragListener (PressListener.ts:527:9)
at call (DragListener.ts:308:35)
id: Bayes Puppeteer
Snapshot from 7/4/2022, 7:33:56 AM

----------------------------------

ph-scale : autofill-fuzz : unbuilt : query-parameters
https://bayes.colorado.edu/continuous-testing/ct-snapshots/1656941636348/ph-scale/ph-scale_en.html?continuousTest=%7B%22test%22%3A%5B%22ph-scale%22%2C%22autofill-fuzz%22%2C%22unbuilt%22%2C%22query-parameters%22%5D%2C%22snapshotName%22%3A%22snapshot-1656941636348%22%2C%22timestamp%22%3A1656963897733%7D&brand=phet&ea&fuzz&memoryLimit=1000&autoFill=false
Query: brand=phet&ea&fuzz&memoryLimit=1000&autoFill=false
Uncaught Error: Assertion failed: reentry detected, value=15, oldValue=null
Error: Assertion failed: reentry detected, value=15, oldValue=null
at window.assertions.assertFunction (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1656941636348/assert/js/assert.js:28:13)
at assert (ReadOnlyProperty.ts:256:14)
at _notifyListeners (ReadOnlyProperty.ts:210:13)
at set (Property.ts:67:10)
at set (GraphIndicatorDragListener.js:85:21)
at _dragListener (PressListener.ts:527:9)
at call (DragListener.ts:308:35)
at apply (PhetioAction.ts:125:16)
at execute (DragListener.ts:459:21)
at drag (PressListener.ts:896:13)
id: Bayes Puppeteer
Snapshot from 7/4/2022, 7:33:56 AM

----------------------------------

ph-scale : autofill-fuzz : unbuilt : query-parameters
https://bayes.colorado.edu/continuous-testing/ct-snapshots/1656941636348/ph-scale/ph-scale_en.html?continuousTest=%7B%22test%22%3A%5B%22ph-scale%22%2C%22autofill-fuzz%22%2C%22unbuilt%22%2C%22query-parameters%22%5D%2C%22snapshotName%22%3A%22snapshot-1656941636348%22%2C%22timestamp%22%3A1656969810252%7D&brand=phet&ea&fuzz&memoryLimit=1000&autoFill=false
Query: brand=phet&ea&fuzz&memoryLimit=1000&autoFill=false
Uncaught Error: Assertion failed: validation failed:
Property value not valid: value should have typeof number, value=null
prunedValidator:
[object Object]
Error: Assertion failed: validation failed:
at window.assertions.assertFunction (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1656941636348/assert/js/assert.js:28:13)
at assert (validate.ts:25:16)
at validate (ReadOnlyProperty.ts:176:33)
at listener (TinyEmitter.ts:92:8)
at emit (ReadOnlyProperty.ts:259:22)
at _notifyListeners (ReadOnlyProperty.ts:210:13)
at set (Property.ts:67:10)
at set (GraphIndicatorDragListener.js:85:21)
at _dragListener (PressListener.ts:527:9)
at call (DragListener.ts:308:35)
id: Bayes Puppeteer
Snapshot from 7/4/2022, 7:33:56 AM

----------------------------------

ph-scale : autofill-fuzz : unbuilt : query-parameters
https://bayes.colorado.edu/continuous-testing/ct-snapshots/1656941636348/ph-scale/ph-scale_en.html?continuousTest=%7B%22test%22%3A%5B%22ph-scale%22%2C%22autofill-fuzz%22%2C%22unbuilt%22%2C%22query-parameters%22%5D%2C%22snapshotName%22%3A%22snapshot-1656941636348%22%2C%22timestamp%22%3A1656976155351%7D&brand=phet&ea&fuzz&memoryLimit=1000&autoFill=false
Query: brand=phet&ea&fuzz&memoryLimit=1000&autoFill=false
Uncaught Error: Assertion failed: reentry detected, value=7, oldValue=-1
Error: Assertion failed: reentry detected, value=7, oldValue=-1
at window.assertions.assertFunction (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1656941636348/assert/js/assert.js:28:13)
at assert (ReadOnlyProperty.ts:256:14)
at _notifyListeners (ReadOnlyProperty.ts:210:13)
at set (Property.ts:67:10)
at set (ReadOnlyProperty.ts:321:9)
at reset (Property.ts:60:10)
at reset (NumberProperty.ts:179:10)
at reset (MySolution.js:72:20)
at reset (MySolutionModel.js:43:18)
at reset (MySolutionScreenView.js:104:14)
id: Bayes Puppeteer
Snapshot from 7/4/2022, 7:33:56 AM

----------------------------------

ph-scale : autofill-fuzz : unbuilt : query-parameters
https://bayes.colorado.edu/continuous-testing/ct-snapshots/1656941636348/ph-scale/ph-scale_en.html?continuousTest=%7B%22test%22%3A%5B%22ph-scale%22%2C%22autofill-fuzz%22%2C%22unbuilt%22%2C%22query-parameters%22%5D%2C%22snapshotName%22%3A%22snapshot-1656941636348%22%2C%22timestamp%22%3A1656983361841%7D&brand=phet&ea&fuzz&memoryLimit=1000&autoFill=false
Query: brand=phet&ea&fuzz&memoryLimit=1000&autoFill=false
Uncaught Error: Assertion failed: reentry detected, value=14.204119982655925, oldValue=null
Error: Assertion failed: reentry detected, value=14.204119982655925, oldValue=null
at window.assertions.assertFunction (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1656941636348/assert/js/assert.js:28:13)
at assert (ReadOnlyProperty.ts:256:14)
at _notifyListeners (ReadOnlyProperty.ts:210:13)
at set (Property.ts:67:10)
at set (GraphIndicatorDragListener.js:85:21)
at _dragListener (PressListener.ts:527:9)
at call (DragListener.ts:308:35)
at apply (PhetioAction.ts:125:16)
at execute (DragListener.ts:459:21)
at drag (PressListener.ts:896:13)
id: Bayes Puppeteer
Snapshot from 7/4/2022, 7:33:56 AM

----------------------------------

ph-scale : autofill-fuzz : unbuilt : query-parameters
https://bayes.colorado.edu/continuous-testing/ct-snapshots/1656941636348/ph-scale/ph-scale_en.html?continuousTest=%7B%22test%22%3A%5B%22ph-scale%22%2C%22autofill-fuzz%22%2C%22unbuilt%22%2C%22query-parameters%22%5D%2C%22snapshotName%22%3A%22snapshot-1656941636348%22%2C%22timestamp%22%3A1656989303561%7D&brand=phet&ea&fuzz&memoryLimit=1000&autoFill=false
Query: brand=phet&ea&fuzz&memoryLimit=1000&autoFill=false
Uncaught Error: Assertion failed: reentry detected, value=14.57978359661681, oldValue=null
Error: Assertion failed: reentry detected, value=14.57978359661681, oldValue=null
at window.assertions.assertFunction (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1656941636348/assert/js/assert.js:28:13)
at assert (ReadOnlyProperty.ts:256:14)
at _notifyListeners (ReadOnlyProperty.ts:210:13)
at set (Property.ts:67:10)
at set (GraphIndicatorDragListener.js:85:21)
at _dragListener (PressListener.ts:527:9)
at call (DragListener.ts:308:35)
at apply (PhetioAction.ts:125:16)
at execute (DragListener.ts:459:21)
at drag (PressListener.ts:896:13)
id: Bayes Puppeteer
Snapshot from 7/4/2022, 7:33:56 AM

----------------------------------

ph-scale : autofill-fuzz : unbuilt : query-parameters
https://bayes.colorado.edu/continuous-testing/ct-snapshots/1656941636348/ph-scale/ph-scale_en.html?continuousTest=%7B%22test%22%3A%5B%22ph-scale%22%2C%22autofill-fuzz%22%2C%22unbuilt%22%2C%22query-parameters%22%5D%2C%22snapshotName%22%3A%22snapshot-1656941636348%22%2C%22timestamp%22%3A1657002992933%7D&brand=phet&ea&fuzz&memoryLimit=1000&autoFill=false
Query: brand=phet&ea&fuzz&memoryLimit=1000&autoFill=false
Uncaught Error: Assertion failed: validation failed:
Property value not valid: value should have typeof number, value=null
prunedValidator:
[object Object]
Error: Assertion failed: validation failed:
at window.assertions.assertFunction (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1656941636348/assert/js/assert.js:28:13)
at assert (validate.ts:25:16)
at validate (ReadOnlyProperty.ts:176:33)
at listener (TinyEmitter.ts:92:8)
at emit (ReadOnlyProperty.ts:259:22)
at _notifyListeners (ReadOnlyProperty.ts:210:13)
at set (Property.ts:67:10)
at set (GraphIndicatorDragListener.js:85:21)
at _dragListener (PressListener.ts:527:9)
at call (DragListener.ts:308:35)
id: Bayes Puppeteer
Snapshot from 7/4/2022, 7:33:56 AM

----------------------------------

ph-scale : autofill-fuzz : unbuilt : query-parameters
https://bayes.colorado.edu/continuous-testing/ct-snapshots/1656941636348/ph-scale/ph-scale_en.html?continuousTest=%7B%22test%22%3A%5B%22ph-scale%22%2C%22autofill-fuzz%22%2C%22unbuilt%22%2C%22query-parameters%22%5D%2C%22snapshotName%22%3A%22snapshot-1656941636348%22%2C%22timestamp%22%3A1657015833698%7D&brand=phet&ea&fuzz&memoryLimit=1000&autoFill=false
Query: brand=phet&ea&fuzz&memoryLimit=1000&autoFill=false
Uncaught Error: Assertion failed: reentry detected, value=-1, oldValue=null
Error: Assertion failed: reentry detected, value=-1, oldValue=null
at window.assertions.assertFunction (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1656941636348/assert/js/assert.js:28:13)
at assert (ReadOnlyProperty.ts:256:14)
at _notifyListeners (ReadOnlyProperty.ts:210:13)
at set (Property.ts:67:10)
at set (GraphIndicatorDragListener.js:85:21)
at _dragListener (PressListener.ts:527:9)
at call (DragListener.ts:308:35)
at apply (PhetioAction.ts:125:16)
at execute (DragListener.ts:459:21)
at drag (PressListener.ts:896:13)
id: Bayes Puppeteer
Snapshot from 7/4/2022, 7:33:56 AM

----------------------------------

ph-scale : autofill-fuzz : unbuilt : query-parameters
https://bayes.colorado.edu/continuous-testing/ct-snapshots/1656941636348/ph-scale/ph-scale_en.html?continuousTest=%7B%22test%22%3A%5B%22ph-scale%22%2C%22autofill-fuzz%22%2C%22unbuilt%22%2C%22query-parameters%22%5D%2C%22snapshotName%22%3A%22snapshot-1656941636348%22%2C%22timestamp%22%3A1657029630574%7D&brand=phet&ea&fuzz&memoryLimit=1000&autoFill=false
Query: brand=phet&ea&fuzz&memoryLimit=1000&autoFill=false
Uncaught Error: Assertion failed: reentry detected, value=null, oldValue=15
Error: Assertion failed: reentry detected, value=null, oldValue=15
at window.assertions.assertFunction (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1656941636348/assert/js/assert.js:28:13)
at assert (ReadOnlyProperty.ts:256:14)
at _notifyListeners (ReadOnlyProperty.ts:210:13)
at set (Property.ts:67:10)
at set (GraphIndicatorDragListener.js:85:21)
at _dragListener (PressListener.ts:527:9)
at call (DragListener.ts:308:35)
at apply (PhetioAction.ts:125:16)
at execute (DragListener.ts:459:21)
at drag (PressListener.ts:896:13)
id: Bayes Puppeteer
Snapshot from 7/4/2022, 7:33:56 AM

----------------------------------

ph-scale : fuzz : unbuilt
https://bayes.colorado.edu/continuous-testing/ct-snapshots/1656941636348/ph-scale/ph-scale_en.html?continuousTest=%7B%22test%22%3A%5B%22ph-scale%22%2C%22fuzz%22%2C%22unbuilt%22%5D%2C%22snapshotName%22%3A%22snapshot-1656941636348%22%2C%22timestamp%22%3A1656943238392%7D&brand=phet&ea&fuzz&memoryLimit=1000
Query: brand=phet&ea&fuzz&memoryLimit=1000
Uncaught Error: Assertion failed: validation failed:
Property value not valid: value should have typeof number, value=null
prunedValidator:
[object Object]
Error: Assertion failed: validation failed:
at window.assertions.assertFunction (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1656941636348/assert/js/assert.js:28:13)
at assert (validate.ts:25:16)
at validate (ReadOnlyProperty.ts:176:33)
at listener (TinyEmitter.ts:92:8)
at emit (ReadOnlyProperty.ts:259:22)
at _notifyListeners (ReadOnlyProperty.ts:210:13)
at set (Property.ts:67:10)
at set (GraphIndicatorDragListener.js:85:21)
at _dragListener (PressListener.ts:527:9)
at call (DragListener.ts:308:35)
id: Bayes Puppeteer
Snapshot from 7/4/2022, 7:33:56 AM
@pixelzoom
Copy link
Contributor

pixelzoom commented Jul 5, 2022

Reproduced in master with my working copy, using URL:
http://localhost:8080/ph-scale/ph-scale_en.html?brand=phet&ea&debugger

This is specific to the My Solution screen. To reproduce:

  • Start the sim
  • Go to the My Solution screen
  • Drag either of the "graph indicators" on the graph

There have been no changes to this sim, so it's likely a regression in common code.

@pixelzoom
Copy link
Contributor

pixelzoom commented Jul 5, 2022

This is due to recent changes in ScientificNotationNode.ts for phetsims/scenery-phet#747. The relevant code is in GrabDragListener, which uses ScientificNotationNode.toScientificNotation.

Bisecting commits to ScientificNotationNode.ts reveals that the problem was introduced in phetsims/scenery-phet@5a032253.

@pixelzoom
Copy link
Contributor

pixelzoom commented Jul 5, 2022

Setting a debugger in GrabDragListener drag function reveals that the sign of the exponent is incorrect. (Note that the mantissa rounding was incorrect prior to the change.)

When dragging the OH- graph indicator ...

BEFORE phetsims/scenery-phet@5a032253:

> value
1.0484477197064377e-7
> scientificNotation
{mantissa: '1.1', exponent: '-7'}

AFTER phetsims/scenery-phet@5a032253:

> value
11.011688753818261e-7
> scientificNotation
{mantissa: '1.0', exponent: '7'}

Here's a failing unit test for ScientificNotationNode.js:

  assert.deepEqual( ScientificNotationNode.toScientificNotation( 1.0484477197064377e-7, {
    exponent: NULL_EXPONENT,
    mantissaDecimalPlaces: 1
  } ), { mantissa: '1.0', exponent: '-7' } );

screenshot_1741

@pixelzoom pixelzoom changed the title CT validation failed CT: validation failed: Property value not valid: value should have typeof number, value=null Jul 5, 2022
@pixelzoom pixelzoom changed the title CT: validation failed: Property value not valid: value should have typeof number, value=null CT: value should have typeof number, value=null Jul 5, 2022
pixelzoom added a commit to phetsims/scenery-phet that referenced this issue Jul 5, 2022
@pixelzoom
Copy link
Contributor

pixelzoom commented Jul 5, 2022

In toScientificNotationNode, string parsing was incorrectly stripping the sign off of negative exponents. The sign should only be stripped off of positive exponents. Fixed in the above commit. I'll leave this open until I've verified that CT is happy.

@pixelzoom
Copy link
Contributor

CT is happy. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants