Skip to content

Commit dd48835

Browse files
committed
maintainer: fix checkpoint guard tests after helper update
1 parent 60ed145 commit dd48835

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

maintainer/maintainer_test.go

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ func TestMaintainer_GetMaintainerStatusUsesCommittedCheckpoint(t *testing.T) {
402402

403403
func TestMaintainerCalculateNewCheckpointTs(t *testing.T) {
404404
t.Run("uses reported checkpoint", func(t *testing.T) {
405-
m, selfNodeID := newMaintainerForCheckpointCalculationTest()
405+
m, selfNodeID := newMaintainerForCheckpointCalculationTest(t)
406406
m.checkpointTsByCapture.Set(selfNodeID, heartbeatpb.Watermark{
407407
CheckpointTs: 100,
408408
ResolvedTs: 100,
@@ -417,7 +417,7 @@ func TestMaintainerCalculateNewCheckpointTs(t *testing.T) {
417417
})
418418

419419
t.Run("drops max checkpoint", func(t *testing.T) {
420-
m, selfNodeID := newMaintainerForCheckpointCalculationTest()
420+
m, selfNodeID := newMaintainerForCheckpointCalculationTest(t)
421421
m.checkpointTsByCapture.Set(selfNodeID, heartbeatpb.Watermark{
422422
CheckpointTs: math.MaxUint64,
423423
ResolvedTs: math.MaxUint64,
@@ -431,7 +431,7 @@ func TestMaintainerCalculateNewCheckpointTs(t *testing.T) {
431431
}
432432

433433
func TestMaintainerCalCheckpointTsSkipsInvalidGlobalCheckpoint(t *testing.T) {
434-
m, selfNodeID := newMaintainerForCheckpointCalculationTest()
434+
m, selfNodeID := newMaintainerForCheckpointCalculationTest(t)
435435
m.initialized.Store(true)
436436
m.watermark.Watermark = &heartbeatpb.Watermark{
437437
CheckpointTs: 1,
@@ -473,7 +473,7 @@ func TestMaintainerCalCheckpointTsSkipsInvalidGlobalCheckpoint(t *testing.T) {
473473
}
474474

475475
func TestMaintainerHandleRedoMetaTsMessageUsesRedoCheckpointForRedoController(t *testing.T) {
476-
m, selfNodeID := newMaintainerForRedoCheckpointCalculationTest()
476+
m, selfNodeID := newMaintainerForRedoCheckpointCalculationTest(t)
477477
m.initialized.Store(true)
478478
m.watermark.Watermark = &heartbeatpb.Watermark{
479479
CheckpointTs: 100,
@@ -501,8 +501,9 @@ func TestMaintainerHandleRedoMetaTsMessageUsesRedoCheckpointForRedoController(t
501501
wg.Wait()
502502
}
503503

504-
func newMaintainerForCheckpointCalculationTest() (*Maintainer, node.ID) {
505-
testutil.SetUpTestServices()
504+
func newMaintainerForCheckpointCalculationTest(t testing.TB) (*Maintainer, node.ID) {
505+
t.Helper()
506+
testutil.SetUpTestServices(t)
506507

507508
cfID := common.NewChangeFeedIDWithName("test", common.DefaultKeyspaceName)
508509
selfNode := node.NewInfo("127.0.0.1:8300", "")
@@ -546,8 +547,9 @@ func newMaintainerForCheckpointCalculationTest() (*Maintainer, node.ID) {
546547
return m, selfNode.ID
547548
}
548549

549-
func newMaintainerForRedoCheckpointCalculationTest() (*Maintainer, node.ID) {
550-
testutil.SetUpTestServices()
550+
func newMaintainerForRedoCheckpointCalculationTest(t testing.TB) (*Maintainer, node.ID) {
551+
t.Helper()
552+
testutil.SetUpTestServices(t)
551553

552554
cfID := common.NewChangeFeedIDWithName("test", common.DefaultKeyspaceName)
553555
selfNode := node.NewInfo("127.0.0.1:8300", "")

0 commit comments

Comments
 (0)