Skip to content

Commit

Permalink
fix meta manager test.
Browse files Browse the repository at this point in the history
  • Loading branch information
3AceShowHand committed Nov 2, 2023
1 parent 85fdab3 commit a9dee7c
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions cdc/redo/meta_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
"testing"
"time"

"github.com/pingcap/tiflow/cdc/contextutil"
"github.com/pingcap/tiflow/cdc/model"
"github.com/pingcap/tiflow/cdc/redo/common"
"github.com/pingcap/tiflow/pkg/config"
Expand All @@ -38,9 +37,7 @@ func TestInitAndWriteMeta(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
captureID := "test-capture"
ctx = contextutil.PutCaptureAddrInCtx(ctx, captureID)
changefeedID := model.DefaultChangeFeedID("test-changefeed")
ctx = contextutil.PutChangefeedIDInCtx(ctx, changefeedID)

extStorage, uri, err := util.GetTestExtStorage(ctx, t.TempDir())
require.NoError(t, err)
Expand Down Expand Up @@ -78,7 +75,7 @@ func TestInitAndWriteMeta(t *testing.T) {
Storage: uri.String(),
FlushIntervalInMs: redo.MinFlushIntervalInMs,
}
m := NewMetaManager(changefeedID, cfg, startTs)
m := NewMetaManager(changefeedID, captureID, cfg, startTs)

var eg errgroup.Group
eg.Go(func() error {
Expand Down Expand Up @@ -116,9 +113,7 @@ func TestPreCleanupAndWriteMeta(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
captureID := "test-capture"
ctx = contextutil.PutCaptureAddrInCtx(ctx, captureID)
changefeedID := model.DefaultChangeFeedID("test-changefeed")
ctx = contextutil.PutChangefeedIDInCtx(ctx, changefeedID)

extStorage, uri, err := util.GetTestExtStorage(ctx, t.TempDir())
require.NoError(t, err)
Expand Down Expand Up @@ -156,7 +151,7 @@ func TestPreCleanupAndWriteMeta(t *testing.T) {
Storage: uri.String(),
FlushIntervalInMs: redo.MinFlushIntervalInMs,
}
m := NewMetaManager(changefeedID, cfg, startTs)
m := NewMetaManager(changefeedID, captureID, cfg, startTs)

var eg errgroup.Group
eg.Go(func() error {
Expand Down Expand Up @@ -239,9 +234,7 @@ func TestGCAndCleanup(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
captureID := "test-capture"
ctx = contextutil.PutCaptureAddrInCtx(ctx, captureID)
changefeedID := model.DefaultChangeFeedID("test-changefeed")
ctx = contextutil.PutChangefeedIDInCtx(ctx, changefeedID)

extStorage, uri, err := util.GetTestExtStorage(ctx, t.TempDir())
require.NoError(t, err)
Expand Down Expand Up @@ -286,7 +279,7 @@ func TestGCAndCleanup(t *testing.T) {
Storage: uri.String(),
FlushIntervalInMs: redo.MinFlushIntervalInMs,
}
m := NewMetaManager(changefeedID, cfg, startTs)
m := NewMetaManager(changefeedID, captureID, cfg, startTs)

var eg errgroup.Group
eg.Go(func() error {
Expand Down

0 comments on commit a9dee7c

Please sign in to comment.