Skip to content

Commit ddf7669

Browse files
committed
roachpb: deflake and unskip test make priority
`TestMakePriority` was skipped in cockroachdb#110354 due to flakes. The test began to flake after upgrading to `go1.20` in cockroachdb#109773, as the global rand was seeded differently. Bump the number of trials from 100k to 750k in order to collect more samples of the underlying distribution, which deflakes the test. This doubles the average test time, from 200ms to 400ms on a GCP C2 instance. Passes 50k runs: ``` dev test pkg/roachpb -f TestMakePriority -v --stress --count=50000 ... //pkg/roachpb:roachpb_test PASSED in 0.9s Stats over 50000 runs: max = 0.9s, min = 0.3s, avg = 0.4s, dev = 0.0s ``` Fixes: cockroachdb#110303 Release note: None
1 parent c17fb50 commit ddf7669

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

pkg/roachpb/BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ go_test(
7777
"//pkg/kv/kvserver/concurrency/isolation",
7878
"//pkg/kv/kvserver/concurrency/lock",
7979
"//pkg/storage/enginepb",
80-
"//pkg/testutils/skip",
8180
"//pkg/testutils/zerofields",
8281
"//pkg/util",
8382
"//pkg/util/bitarray",

pkg/roachpb/data_test.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import (
2626
"github.com/cockroachdb/cockroach/pkg/kv/kvserver/concurrency/isolation"
2727
"github.com/cockroachdb/cockroach/pkg/kv/kvserver/concurrency/lock"
2828
"github.com/cockroachdb/cockroach/pkg/storage/enginepb"
29-
"github.com/cockroachdb/cockroach/pkg/testutils/skip"
3029
"github.com/cockroachdb/cockroach/pkg/testutils/zerofields"
3130
"github.com/cockroachdb/cockroach/pkg/util"
3231
"github.com/cockroachdb/cockroach/pkg/util/bitarray"
@@ -909,7 +908,6 @@ func checkVal(val, expected, errFraction float64) bool {
909908
// in MakePriority returning priorities that are P times more likely
910909
// to be higher than a priority with user priority = 1.
911910
func TestMakePriority(t *testing.T) {
912-
skip.WithIssue(t, 110303, "flaky test")
913911
// Verify min & max.
914912
if a, e := MakePriority(MinUserPriority), enginepb.MinTxnPriority; a != e {
915913
t.Errorf("expected min txn priority %d; got %d", e, a)
@@ -932,7 +930,7 @@ func TestMakePriority(t *testing.T) {
932930
}
933931

934932
// Generate values for all priorities.
935-
const trials = 100000
933+
const trials = 750000
936934
values := make([][trials]enginepb.TxnPriority, len(userPs))
937935
for i, userPri := range userPs {
938936
for tr := 0; tr < trials; tr++ {

0 commit comments

Comments
 (0)