Skip to content

Commit 0e35b2b

Browse files
authored
Merge pull request #153210 from cockroachdb/blathers/backport-release-25.2-152880
release-25.2: changefeedccl: fix reversed args for containment check in test logic
2 parents dffc2d0 + 4aeb100 commit 0e35b2b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pkg/ccl/changefeedccl/changefeedbase/errors_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func TestAsTerminalError(t *testing.T) {
4646
t.Run("node drain marked as job retry", func(t *testing.T) {
4747
cause := errors.New("some error happened")
4848
termErr := changefeedbase.AsTerminalError(context.Background(), nodeIsDraining, cause)
49-
require.Contains(t, cause.Error(), termErr.Error())
49+
require.Contains(t, termErr.Error(), cause.Error())
5050
require.True(t, jobs.IsRetryJobError(termErr))
5151
})
5252

@@ -55,19 +55,19 @@ func TestAsTerminalError(t *testing.T) {
5555
cause := changefeedbase.WithTerminalError(
5656
changefeedbase.MarkRetryableError(errors.New("confusing error")))
5757
termErr := changefeedbase.AsTerminalError(context.Background(), nodeIsNotDraining, cause)
58-
require.Contains(t, cause.Error(), termErr.Error())
58+
require.Contains(t, termErr.Error(), cause.Error())
5959
})
6060

6161
t.Run("assertion failures are terminal", func(t *testing.T) {
6262
// Assertion failures are terminal, even if marked as retry-able.
6363
cause := changefeedbase.MarkRetryableError(errors.AssertionFailedf("though shall not pass"))
6464
termErr := changefeedbase.AsTerminalError(context.Background(), nodeIsNotDraining, cause)
65-
require.Contains(t, cause.Error(), termErr.Error())
65+
require.Contains(t, termErr.Error(), cause.Error())
6666
})
6767

6868
t.Run("gc error is terminal", func(t *testing.T) {
6969
cause := changefeedbase.MarkRetryableError(&kvpb.BatchTimestampBeforeGCError{})
7070
termErr := changefeedbase.AsTerminalError(context.Background(), nodeIsNotDraining, cause)
71-
require.Contains(t, cause.Error(), termErr.Error())
71+
require.Contains(t, termErr.Error(), cause.Error())
7272
})
7373
}

0 commit comments

Comments
 (0)