-
Notifications
You must be signed in to change notification settings - Fork 6.3k
refactor(testing): fix flaky terminal test #3230
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
Conversation
Codecov Report
Merging #3230 (45df7b5) into main (1e683f3) will not change coverage.
The diff coverage isn/a
.
❗ Current head 45df7b5 differs from pull request most recent head 449c6da. Consider uploading reports for the commit 449c6da to get more accurate results
Impacted file tree graph
@@ Coverage Diff @@ ## main #3230 +/- ## ======================================= Coverage 46.90% 46.90% ======================================= Files 23 23 Lines 1196 1196 Branches 237 237 ======================================= Hits 561 561 Misses 451 451 Partials 184 184
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 1e683f3...449c6da. Read the comment docs.
45df7b5
to
7529975
Compare
7529975
to
449c6da
Compare
@jawnsy
jawnsy
Apr 27, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ahah these things make me sad, totally fair though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol i know. sadly, this timeout was the only thing that made it consistently pass.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ I realized how many places I was using this in the model so refactored it into a property of the class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol i know. sadly, this timeout was the only thing that made it consistently pass.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This approach produces consistent results — no matter if the terminal is already focused, visible/not visible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also seems to be better than looking for the div.terminal.xterm.focus
selector, which may or may not appear.
H/T to @kylecarbs for the suggestion 🎉
xterm source
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no great way of knowing that the terminal received both the input and the enter and processed it (because it's a <canvas>
element so we can't assert the text on screen) so having this timeout accounts for any slowness that might occur.
Uh oh!
There was an error while loading. Please reload this page.
This PR fixes a flaky implementation of the
focusTerminal
method on theCodeServer
model.This was caught after merging into #3169
main
and the e2e tests failed here 😅Changes:
reloadUntilEditorIsVisible
method. It wasn't waiting for code-server to fully load before reloading. before "Editor became visible after 11 reloads -> "Editor became visible after 1 reload"focusTerminal
method.Before
The
should show the Integrated Terminal
only passed intermittently in Firefox:e4bebc41-637c-4949-9b13-ddf10f64a6cc.mp4
What's happening: it's waiting for the selector
div.terminal.xterm.focus
to be visible, which doesn't happen for some reason and the test times-out.image
After
image
image