Skip to content
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

Fixing flaky validator tests #12339

Merged
merged 3 commits into from
Apr 27, 2023
Merged

Fixing flaky validator tests #12339

merged 3 commits into from
Apr 27, 2023

Conversation

kasey
Copy link
Contributor

@kasey kasey commented Apr 27, 2023

What type of PR is this?

Bug fix

What does this PR do? Why is it needed?

The validator run() loop code is tricky to test because it's based around a big channel select statement. Tests on this loop are flaky because they cancel the run loops context right after sending it a message over a channel and then checking that the receiving end called expected functions, resulting in a race between the context cancellation and the handler. To simplify things I broke out the piece of the handler that this flaky func wants to test into it's own synchronous func.

@kasey kasey requested a review from a team as a code owner April 27, 2023 00:01
@kasey kasey requested review from terencechain, rkapka and nisdas April 27, 2023 00:01
@prylabs-bulldozer prylabs-bulldozer bot merged commit cec631d into develop Apr 27, 2023
@delete-merged-branch delete-merged-branch bot deleted the validator-flakes branch April 27, 2023 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants