Skip to content

Commit

Permalink
roachtest: use a fixed seed for rng in import-cancellation roachtest
Browse files Browse the repository at this point in the history
Currently, due to the randomness present in the test, there may be
significant variance in test runs. In some situations, the nature of the
random import cancellations may result in the test timing out. This
makes the test flaky.

Use a fixed seed for the test's PRNG to make the test more
deterministic.

Fix cockroachdb#90510.

Release note: None.
  • Loading branch information
nicktrav committed Oct 22, 2022
1 parent cdf4b18 commit 288ede3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/cmd/roachtest/tests/import_cancellation.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ func runImportCancellation(ctx context.Context, t test.Test, c cluster.Cluster)
t.Fatal(err)
}

rng, seed := randutil.NewPseudoRand()
seed := int64(1666467482296309000)
rng := randutil.NewTestRandWithSeed(seed)

tablesToNumFiles := map[string]int{
"region": 1,
Expand Down

0 comments on commit 288ede3

Please sign in to comment.