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 matching tenFrameNode not found! #195

Closed
KatieWoe opened this issue Nov 28, 2022 · 8 comments
Closed

CT matching tenFrameNode not found! #195

KatieWoe opened this issue Nov 28, 2022 · 8 comments

Comments

@KatieWoe
Copy link

number-compare : multitouch-fuzz : unbuilt
https://bayes.colorado.edu/continuous-testing/ct-snapshots/1669628102736/number-compare/number-compare_en.html?continuousTest=%7B%22test%22%3A%5B%22number-compare%22%2C%22multitouch-fuzz%22%2C%22unbuilt%22%5D%2C%22snapshotName%22%3A%22snapshot-1669628102736%22%2C%22timestamp%22%3A1669637012626%7D&brand=phet&ea&fuzz&fuzzPointers=2&memoryLimit=1000&supportsPanAndZoom=false
Query: brand=phet&ea&fuzz&fuzzPointers=2&memoryLimit=1000&supportsPanAndZoom=false
Uncaught Error: Assertion failed: matching tenFrameNode not found!
Error: Assertion failed: matching tenFrameNode not found!
at window.assertions.assertFunction (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1669628102736/assert/js/assert.js:28:13)
at assert (LabScreenView.ts:360:14)
at getTenFrameNode (LabScreenView.ts:303:36)
at dropListener (DraggableTenFrameNode.ts:68:16)
at _end (DragListener.ts:394:24)
at callback (PressListener.ts:752:16)
at apply (PhetioAction.ts:157:16)
at execute (PressListener.ts:510:24)
at release (DragListener.ts:390:10)
at release (PressListener.ts:851:11)
id: Bayes Puppeteer
Snapshot from 11/28/2022, 2:35:02 AM
@chrisklus
Copy link
Contributor

@pixelzoom and I are going to pair on this 9am thursday

@pixelzoom
Copy link
Contributor

This is occurring in the Lab screen, which is found in both number-play and number-compare. Since LabScreen.ts lives in number-play, I'm going to transfer this issue to that repo.

@pixelzoom pixelzoom transferred this issue from phetsims/number-compare Jan 4, 2023
@pixelzoom
Copy link
Contributor

pixelzoom commented Jan 4, 2023

Most of the occurrence in CT are for test "multitouch-fuzz : unbuilt", a few are for test "pan-and-zoom-fuzz : unbuilt".

Query parameters for "multitouch-fuzz : unbuilt" test are:

  • brand=phet&screens=4&ea&fuzz&fuzzPointers=2&memoryLimit=1000&supportsPanAndZoom=false

Query parameters for test "pan-and-zoom-fuzz : unbuilt" are:

  • brand=phet&ea&fuzz&fuzzPointers=2&memoryLimit=1000&supportsPanAndZoom=true

I reproduced in master with this URL, which is a modified form of the "multitouch-fuzz : unbuilt" test:

Note that I added screens=4 to the URL, so that I'm running only the Lab screen. This makes the error occur more quickly. And I removed memoryLimit=1000 because it's irrelevant.

@pixelzoom
Copy link
Contributor

pixelzoom commented Jan 4, 2023

I tried to shorten the URL, and could not reproduce with:
http://localhost:8080/number-play/number-play_en.html?brand=phet&screens=4&ea&fuzz

So fuzzPointer=2 is required to reproduce, so this problem is almost certainly specific to multitouch.

supportsPanAndZoom is not required to reproduce, since it fails in CT with values of true and false. But using supportsPanAndZoom=false makes it occur more quickly, probably because the sim isn't spending time panning and zooming.

So... The URL for testing is:

@pixelzoom
Copy link
Contributor

pixelzoom commented Jan 4, 2023

Here's a current stack trace when running from master unbuilt:

assert.js:28 Uncaught Error: Assertion failed: matching tenFrameNode not found!
at window.assertions.assertFunction (assert.js:28:13)
at LabScreenView.getTenFrameNode (LabScreenView.ts:360:15)
at Object.dropListener (LabScreenView.ts:303:37)
at DragListener.end [as _end] (DraggableTenFrameNode.ts:68:17)
at DragListener.ts:394:25
at DragListener.onRelease (PressListener.ts:750:17)
at PhetioAction.execute (PhetioAction.ts:157:17)
at DragListener.release (PressListener.ts:508:25)
at DragListener.release (DragListener.ts:390:11)
at DragListener.pointerUp (PressListener.ts:849:12)

Here's the relevant code (with assertion) in LabScreenView.ts:

  public getTenFrameNode( tenFrame: TenFrame ): DraggableTenFrameNode {
    const tenFrameNode = _.find( this.tenFrameNodes, tenFrameNode => tenFrameNode.tenFrame === tenFrame );
    assert && assert( tenFrameNode, 'matching tenFrameNode not found!' );
    return tenFrameNode!;
  }

@pixelzoom
Copy link
Contributor

pixelzoom commented Jan 4, 2023

To reproduce manually:

  1. Tether an iPad to a MacBook.
  2. Open Safari on the MacBook. Choose the iPad from the Develop menu.
  3. Open Safari on the iPad, and run the Number Play sim from phetmarks.
  4. Go to the Lab screen.
  5. With one finger, drag a Ten Frame out of the tool box, but do not release it.
  6. With another finger, press the Reset All button. The assertion failure will occur.

The problem is that Reset All deletes everything, including the TenFrame model element that is being dragged. When the TenFrame instance is disposed, its associated TenFrameNode is also disposed. This causes the drag listener to be interrupted, and it's end function is called. That end function then calls getTenFrameNode, finds that the TenFrame instance no longer exists, and fails the assertion.

pixelzoom added a commit to phetsims/number-suite-common that referenced this issue Jan 4, 2023
@pixelzoom
Copy link
Contributor

pixelzoom commented Jan 4, 2023

Fixed in the above commit by short-circuiting dropListener when the tenFrameNode as already been disposed. Tested using the procedure in #195 (comment). I have not yet confirmed that CT is happy.

@chrisklus please review.

@chrisklus
Copy link
Contributor

Thanks @pixelzoom. Commits look good and CT has in not showing this problem anymore. 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

3 participants