Repository navigation
Take the initial viz test screenshots from the newest image - #4095
Merged
Merged
Conversation
|
Performance benchmarks:
|
EwoutH
approved these changes
Nov 16, 2026
EwoutH
left a comment
Member
There was a problem hiding this comment.
This unpredictable test error was quite irritating. Thanks!
EwoutH
pushed a commit
that referenced
this pull request
Nov 22, 2026
Fixes the flaky Playwright viz tests by taking the two initial screenshots from the newest image, like the later screenshots already do. (cherry picked from commit 667c62b)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pre-PR Checklist
Summary
Fixes the flaky Playwright viz tests by taking the two initial screenshots from the newest image, like the later screenshots already do.
Bug / Issue
Fixes #4094
After
display(), the page briefly holds the old and the new<img>. The initial screenshots use the barelocator("img"), so if they run in that window, Playwright's strict mode fails with "resolved to 2 elements". This failed CI on #3953 and #4064 this week.sequenceDiagram participant T as test participant P as page T->>P: display(graph_viz) Note over P: old img + new img (briefly) T->>P: locator("img").screenshot() P-->>T: strict mode violation (2 elements) Note over T: with .last: always the new imgImplementation
.laston the two initial screenshots inrun_model_test. #3039 and #3670 made the same change for the screenshots after the model steps, so all four now pick the image the same way.Testing
display(graph_viz): 2 on the first check, then 1, and.lastwas always the new image (6 of 6 runs).display()reproduces the CI error every time onmain. With.last, all 9 viz tests pass in that setup (3 of 3 runs).pytest tests/examples/test_examples_viz.py: 9 passed. Pre-commit passes.