Skip to content

Conversation

@jeffswenson
Copy link
Collaborator

This test will sometimes fail due to a randomly picking a value that rounds to 1/2. Using a deterministic seed ensures the test will never flake.

Release note: none
Fixes: #128381
Fixes: #157113

This test will sometimes fail due to a randomly picking a value that
rounds to 1/2. Using a deterministic seed ensures the test will never
flake.

Release note: none
Fixes: cockroachdb#128381
Fixes: cockroachdb#157113
@jeffswenson jeffswenson requested a review from msbutler November 17, 2025 21:54
@jeffswenson jeffswenson requested review from a team as code owners November 17, 2025 21:54
@jeffswenson jeffswenson added the backport-all Flags PRs that need to be backported to all supported release branches label Nov 17, 2025
@cockroach-teamcity
Copy link
Member

This change is Reviewable

// where the test flakes because the random value rounds to 1/2. This is more
// common than you would expect because its probability is based on the width
// of the duration, not the width of the random float.
rand.Seed(4)
Copy link
Collaborator

@stevendanna stevendanna Nov 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was a little concerned that setting this global seed might impact other randomized tests. But then I read that perhaps this isn't doing what we want in the first place:

// As of Go 1.24 [Seed] is a no-op. To restore the previous behavior set
// GODEBUG=randseednop=0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-all Flags PRs that need to be backported to all supported release branches

Projects

None yet

Development

Successfully merging this pull request may close these issues.

jobs: TestJitterCalculation failed jobs: TestJitterCalculation failed

3 participants