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

Prevent pollution between scenario tests #11850

Merged
merged 4 commits into from
Jan 6, 2023
Merged

Conversation

kasey
Copy link
Contributor

@kasey kasey commented Jan 5, 2023

In a few e2e evaluators, package-level variables are used to persist data across evaluator calls, which are otherwise stateless. In the scenario test runs, where we execute multiple tests in the same bazel command, these variables are contaminated on all but the first test. I think we should redesign these evaluators with the understanding that some can't be stateless, but all need to reset between runs. This PR moves stateful values from package-level variables in the evaluators package, into the EvaluationContext that is already passed to all evaluators, which is re-initialized between runs.

What type of PR is this?

Bug fix

What does this PR do? Why is it needed?

This fixes a spurious test failure for the TestEndToEnd_MinimalConfig_ValidatorRESTApi target, specifically this evaluator:

    --- FAIL: TestEndToEnd_MinimalConfig_ValidatorRESTApi/voluntary_has_exited_8 (0.00s)

@kasey kasey requested a review from nisdas January 5, 2023 20:56
@kasey kasey requested a review from a team as a code owner January 5, 2023 20:56
@kasey kasey requested review from saolyn and james-prysm January 5, 2023 20:56
@prylabs-bulldozer prylabs-bulldozer bot merged commit 1c27b21 into develop Jan 6, 2023
@delete-merged-branch delete-merged-branch bot deleted the hermetic-e2e-evals branch January 6, 2023 07:49
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