Skip to content

Commit d4a53c9

Browse files
craig[bot]yuzefovich
andcommitted
157783: copy: fix some flakes with recently adjusted TestLargeCopy r=yuzefovich a=yuzefovich We've observed two flakes when performing ALTER PRIMARY KEY concurrently with the COPY. Epic: None Release note: None Co-authored-by: Yahor Yuzefovich <[email protected]>
2 parents 51d7523 + 0e3a370 commit d4a53c9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/sql/copy/copy_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -740,6 +740,8 @@ func TestLargeCopy(t *testing.T) {
740740
// We might hit a duplicate key error when changing the primary key
741741
// (which seems somewhat expected), so we'll ignore such an error.
742742
return strings.Contains(err.Error(), "duplicate key") ||
743+
// We might be forced to restart - also seems somewhat expected.
744+
strings.Contains(err.Error(), "restart transaction") ||
743745
// TODO(yuzefovich): occasionally we get this error, and it's not
744746
// clear why. Look into this.
745747
strings.Contains(err.Error(), "cannot disable pipelining on a running transaction")
@@ -767,7 +769,9 @@ func TestLargeCopy(t *testing.T) {
767769
if !ignoreErr(alterErr) {
768770
t.Fatal(alterErr)
769771
}
770-
require.Equal(t, int(numrows), rows)
772+
if copyErr == nil {
773+
require.Equal(t, int(numrows), rows)
774+
}
771775
}
772776

773777
type copyReader struct {

0 commit comments

Comments
 (0)