-
Notifications
You must be signed in to change notification settings - Fork 104
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
Nit: Combine App::state and App::userState to fix test races #9618
Conversation
6b36f80
to
c9a1875
Compare
This is confusing having both a |
6c72ac5
to
3453322
Compare
3453322
to
eed3aab
Compare
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 really, really like this change. Thank you!
One question on a change. Thanks!
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.
Thanks, looks great!
Description
Spotted in the wild: a flaky testSubscription.js.
This was hauntingly familliar to a bug I fixed in one of my experimental hackathons in which
vpn.authenticateInApp()
returns success as soon as we get to theUserAuthenticated
state but the model initialization is still waiting on a bunch of tasks to finish. If this happens during the initial test setup, and we quit before those jobs finish - we are left with a settings file that is incomplete (the token is set but no keys are) and all the subsequent test jobs fail to load.To fix this properly, I think the best approach is to combine the
App::state
andApp::userState
states together to eliminate potential race conditions between them, and to add a newuserAuthenticated
property that returnstrue
once the auth is completed.Reference
Cherry-picking a bunch of stuff from PR #9584
Flaky test run: testSubscription.js
Checklist