-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Always wait for doCheck to complete before returning #10878
Merged
Merged
Conversation
This file contains 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
I see that you haven't updated any CHANGELOG files. Would it make sense to do so? |
amirylm
reviewed
Oct 10, 2023
amirylm
reviewed
Oct 10, 2023
core/services/ocr2/plugins/ocr2keeper/evm21/registry_check_pipeline.go
Outdated
Show resolved
Hide resolved
ferglor
force-pushed
the
spike/registry-lookup-testflake
branch
2 times, most recently
from
October 17, 2023 23:52
b228dbf
to
312aa37
Compare
ferglor
changed the title
Spike: Always wait for doCheck to complete before returning
Always wait for doCheck to complete before returning
Oct 18, 2023
ferglor
force-pushed
the
spike/registry-lookup-testflake
branch
from
October 18, 2023 07:53
0f56b60
to
01c9801
Compare
amirylm
previously approved these changes
Oct 20, 2023
ferglor
force-pushed
the
spike/registry-lookup-testflake
branch
from
November 8, 2023 13:32
01c9801
to
047e8eb
Compare
Use threadctrl to avail of context cancellation but still rely on a wait group to blocl until the lookups finish Update tests
ferglor
force-pushed
the
spike/registry-lookup-testflake
branch
from
November 9, 2023 15:28
77e98c1
to
c6e09f1
Compare
SonarQube Quality Gate |
cmalec
approved these changes
Nov 9, 2023
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.
AUTO-6343
We received a notification that some of our tests were flaking in CI: https://chainlink-core.slack.com/archives/C02UPK655SN/p1696419424628789
It seemed to be the case that, in our tests, we were encountering a panic because the test logger was being written to by our application code, after our test had finished.
In our application code, we run doCheck asynchronously, then wait for the result channel to receive a value, or for the parent context to be cancelled.
I think this particular flake is caused by the cancellation of the context while
doCheck
is still executing. When the context is cancelled, we return, which subsequently allows the test to execute until completion. However, it's possible thatdoCheck
is still running in the background, and writing to the test logger.This change uses a wait group to wait for doCheck to complete, even when the parent context is cancelled. It feels like an inappropriate solution given that we seem to anticipate context cancellations in our code, but the problem is that doCheck and its child functions do not check for context cancellations, so the simpler solution is to instead wait for doCheck to finish execution before returning.