Skip to content

Commit

Permalink
roachtest: import-cancellation: use a fixed seed; smaller import
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.

Additionally, reduce the size of the overall import by lowering the
number of files used to generate the `lineitem` table. This should also
help stabilize the runtime.

Fix cockroachdb#90510.

Release note: None.
  • Loading branch information
nicktrav committed Oct 24, 2022
1 parent cdf4b18 commit a09f841
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions 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 All @@ -93,7 +94,7 @@ func runImportCancellation(ctx context.Context, t test.Test, c cluster.Cluster)
"partsupp": 8,
"customer": 8,
"orders": 8,
"lineitem": 8,
"lineitem": 2,
}
for tbl := range tablesToNumFiles {
fixtureURL := fmt.Sprintf("gs://cockroach-fixtures/tpch-csv/schema/%s.sql?AUTH=implicit", tbl)
Expand Down

0 comments on commit a09f841

Please sign in to comment.