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

testutils: fix determinism in random predecessor history tests #107950

Merged

Conversation

renatolabs
Copy link
Contributor

Previously, the rng instance used by the tests was initialized once in the var block. That meant that every assertion that relied on that rng was order-dependent: running a single test in that file in isolation would lead to failed assertions.

This commit ensures that every test resets the rng before making any assertions, guaranteeing we get the same values regardless of execution order.

Epic: none

Release note: None

Previously, the `rng` instance used by the tests was initialized once
in the `var` block. That meant that every assertion that relied on
that rng was order-dependent: running a single test in that file in
isolation would lead to failed assertions.

This commit ensures that every test resets the rng before making any
assertions, guaranteeing we get the same values regardless of
execution order.

Epic: none

Release note: None
@renatolabs renatolabs added the backport-23.1.x Flags PRs that need to be backported to 23.1 label Aug 1, 2023
@renatolabs renatolabs requested review from jayshrivastava, a team, herkolategan and srosenberg and removed request for a team August 1, 2023 15:09
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@renatolabs
Copy link
Contributor Author

TFTR!

bors r=jayshrivastava

@craig
Copy link
Contributor

craig bot commented Aug 1, 2023

This PR was included in a batch that successfully built, but then failed to merge into master (it was a non-fast-forward update). It will be automatically retried.

@craig
Copy link
Contributor

craig bot commented Aug 1, 2023

Build succeeded:

@craig craig bot merged commit 509f8c8 into cockroachdb:master Aug 1, 2023
@renatolabs renatolabs deleted the rc/fix-random-predecessor-history-test branch August 1, 2023 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-23.1.x Flags PRs that need to be backported to 23.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants