-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Fix test: set up mocks before starting the service #126719
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
Pinging @elastic/es-core-infra (Team:Core/Infra) |
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.
Does this solve the race by mocking before we start the file settings service? A comment might be useful.
I opened this in case the Mockito folks agree this is good advice. |
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.
LGTM
💔 Backport failed
You can use sqren/backport to manually backport by running |
Reportedly, Mockito uses some shared global state that cannot tolerate races between setup and usage of mocks.
This PR moves some mock setup code up earlier before
FileSettingsService.start()
to make sure we don't try to use some mocks while still configuring others.Fixes #120482.