@@ -404,7 +404,29 @@ func TestChangefeedAlterPTS(t *testing.T) {
404
404
405
405
_ , _ = expectResolvedTimestamp (t , f2 )
406
406
407
- require .Equal (t , 1 , getNumPTSRecords ())
407
+ perTablePTSEnabled :=
408
+ changefeedbase .PerTableProtectedTimestamps .Get (& s .Server .ClusterSettings ().SV ) &&
409
+ changefeedbase .TrackPerTableProgress .Get (& s .Server .ClusterSettings ().SV )
410
+
411
+ if perTablePTSEnabled {
412
+ eFeed , ok := f2 .(cdctest.EnterpriseTestFeed )
413
+ require .True (t , ok )
414
+ hwm , err := eFeed .HighWaterMark ()
415
+ require .NoError (t , err )
416
+ require .NoError (t , eFeed .WaitForHighWaterMark (hwm ))
417
+
418
+ require .Equal (t , 2 , getNumPTSRecords ())
419
+ // testutils.SucceedsSoon(t, func() error {
420
+ // // Wait for the per-table PTS record to be created for the second table.
421
+ // // This happens the next time we advance the highwater.
422
+ // if getNumPTSRecords() != 2 {
423
+ // return errors.Newf("expected 2 PTS records, got %d", getNumPTSRecords())
424
+ // }
425
+ // return nil
426
+ // })
427
+ } else {
428
+ require .Equal (t , 1 , getNumPTSRecords ())
429
+ }
408
430
}
409
431
410
432
cdcTest (t , testFn , feedTestEnterpriseSinks )
0 commit comments