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

Backport of tests: don't mutate global structs in core scheduler tests into release/1.4.x #16125

Conversation

hc-github-team-nomad-core
Copy link
Contributor

Backport

This PR is auto-generated from #16120 to be assessed for backporting due to the inclusion of the label backport/1.4.x.

The below text is copied from the body of the original PR.


Some of the core scheduler tests need the maximum batch size for writes to be smaller than the usual structs.MaxUUIDsPerWriteRequest. But they do so by unsafely modifying the global struct, which creates test flakes in other tests.

Modify the functions under test to take a batch size parameter. Production code will pass the global while the tests can inject smaller values. Turn the structs.MaxUUIDsPerWriteRequest into a constant, and add a semgrep rule for avoiding this kind of thing in the future.

Discovered while trying to debug #16112, but this should get backported to all supported versions whereas that will be only to 1.4.x

@hc-github-team-nomad-core hc-github-team-nomad-core force-pushed the backport/b-flaky-core-sched-tests/privately-tight-grizzly branch from d5ef7c9 to 7263f75 Compare February 10, 2023 14:26
@hc-github-team-nomad-core hc-github-team-nomad-core merged commit a38eb37 into release/1.4.x Feb 10, 2023
@hc-github-team-nomad-core hc-github-team-nomad-core deleted the backport/b-flaky-core-sched-tests/privately-tight-grizzly branch February 10, 2023 14:26
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.

None yet

2 participants