Skip to content

Commit a20cf2d

Browse files
craig[bot]jayshrivastava
andcommitted
108143: changefeedccl: deflake TestChangefeedSchemaChangeBackfillCheckpoint r=miretskiy a=jayshrivastava When using the declarative schema changer, we should refresh the span to assert at the end because it may change due to a primary index swap during the schema change. Release note: None Fixes: cockroachdb#108084 Epic: None Co-authored-by: Jayant Shrivastava <[email protected]>
2 parents 459f540 + 157cffd commit a20cf2d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pkg/ccl/changefeedccl/changefeed_test.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2092,9 +2092,15 @@ func TestChangefeedSchemaChangeBackfillCheckpoint(t *testing.T) {
20922092
// Pause job to avoid race on the resolved array
20932093
require.NoError(t, jobFeed.Pause())
20942094

2095+
// NB: With the declarative schema changer, there is a primary index swap,
2096+
// so the primary index span will change.
2097+
freshFooDesc := desctestutils.TestingGetPublicTableDescriptor(
2098+
s.SystemServer.DB(), s.Codec, "d", "foo")
2099+
tableSpanAfter := freshFooDesc.PrimaryIndexSpan(s.Codec)
2100+
20952101
// Verify that none of the resolved spans after resume were checkpointed.
20962102
for _, sp := range resolved {
2097-
require.Falsef(t, !sp.Equal(tableSpan) && secondCheckpoint.Contains(sp.Key), "span should not have been resolved: %s", sp)
2103+
require.Falsef(t, !sp.Equal(tableSpanAfter) && secondCheckpoint.Contains(sp.Key), "span should not have been resolved: %s", sp)
20982104
}
20992105
}
21002106

0 commit comments

Comments
 (0)