Skip to content

Commit 859c062

Browse files
craig[bot]yuzefovich
andcommitted
Merge #152477
152477: ttljob: de-flake TestRowLevelTTLJobRandomEntries r=yuzefovich a=yuzefovich Recently in c859f00 we prohibited the usage of LTREE type in the mixed version state. We missed that we needed to update a TTL test that uses random types in one test case, which can run in mixed-version state, so this commit fixes that omission. Fixes: #152373. Release note: None Co-authored-by: Yahor Yuzefovich <[email protected]>
2 parents a4b47dc + ca5058a commit 859c062

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

pkg/sql/ttl/ttljob/ttljob_test.go

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99
"bytes"
1010
"context"
1111
"fmt"
12-
"math/rand"
1312
"regexp"
1413
"strconv"
1514
"strings"
@@ -702,9 +701,17 @@ func TestRowLevelTTLJobRandomEntries(t *testing.T) {
702701
// causes parsing errors.
703702
case types.CollatedStringFamily:
704703
if typ.Oid() != oidext.T_citext && typ.Oid() != oidext.T__citext {
705-
// TODO(foundations): CITEXT should only be prohibited when
706-
// running with mixed 25.2 version where the type is not
707-
// supported.
704+
if int(clusterversion.MinSupported) >= int(clusterversion.V25_3) {
705+
// CITEXT is only supported in 25.3+, so if we happen to run
706+
// the test in the mixed version variant, we can't use the
707+
// type.
708+
indexableTyps = append(indexableTyps, typ)
709+
}
710+
}
711+
case types.LTreeFamily:
712+
if int(clusterversion.MinSupported) >= int(clusterversion.V25_4) {
713+
// LTREE is only supported in 25.4+, so if we happen to run the
714+
// test in the mixed version variant, we can't use the type.
708715
indexableTyps = append(indexableTyps, typ)
709716
}
710717
default:
@@ -956,7 +963,7 @@ func TestRowLevelTTLJobRandomEntries(t *testing.T) {
956963

957964
for _, tc := range testCases {
958965
t.Run(tc.desc, func(t *testing.T) {
959-
runAtMixedClusterVersion := rand.Intn(2) == 0
966+
runAtMixedClusterVersion := rng.Intn(2) == 0
960967
// Log to make it slightly easier to reproduce a random config.
961968
t.Logf("test case (runAtMixedClusterVersion=%t): %#v", runAtMixedClusterVersion, tc)
962969
th, cleanupFunc := newRowLevelTTLTestJobTestHelper(

0 commit comments

Comments
 (0)