-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Fix the feature tests with a retry #8534
Conversation
Hey look, this works!
It's silly, but it gets the job done, right? |
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.
Yeah this is a good call. Thanks.
src/host/ft_host/InitTests.cpp
Outdated
} | ||
else | ||
{ | ||
setupConsole = true; |
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.
you could also dispense with the boolean and just break
here!
A bunch of our feature tests don't work reliably in CI. They rely on creating a new `OpenConsole.exe` window, then running the test _in that console_. As a part of that test setup, the test runner used to wait a second to attach to the newly created console. Then the test goes on it's merry way, assuming the console is ready to go. However, in CI, that might take more than a second. If it does, then the test would fail pretty immediately, as soon as it tries to get at the buffer of the new console. This PR introduces a little retry loop to the test init. After attaching to the new console, we'll try and get at the screen buffer. If that fails, we'll wait a second and try again. We'll try 5 times total, before bailing entirely. Hopefully, this should mitigate most of the random CI failures we get in the feature tests. Closes microsoft#8495
Looking through this test, I seriously don't understand how this doesn't work. I mean, I don't really get how it _does_ work, but at this point in the tests, we've actually established that both `Nihilist.exe` _and_ openconsole are running. From my read, there's no reason these should be failing at this point. We previously added a "retry 5 times" bit to this test, in #8534. That did work back then. So uh, just do that... again?
A bunch of our feature tests don't work reliably in CI. They rely on creating a new
OpenConsole.exe
window, then running the test in that console. As a part of that test setup, the test runner used to wait a second to attach to the newly created console. Then the test goes on it's merry way, assuming the console is ready to go. However, in CI, that might take more than a second. If it does, then the test would fail pretty immediately, as soon as it tries to get at the buffer of the new console.This PR introduces a little retry loop to the test init. After attaching to the new console, we'll try and get at the screen buffer. If that fails, we'll wait a second and try again. We'll try 5 times total, before bailing entirely. Hopefully, this should mitigate most of the random CI failures we get in the feature tests.