Skip to content

Commit 0555d72

Browse files
committed
fix coordinator test
1 parent f6ec835 commit 0555d72

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

go/logic/coordinator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ func (c *Coordinator) StartStreaming(ctx context.Context, canStopStreaming func(
278278
for {
279279
if err := c.binlogReader.StreamEvents(ctx, c.events); err != nil {
280280
if errors.Is(err, context.Canceled) {
281-
return nil
281+
return err
282282
}
283283

284284
c.migrationContext.Log.Infof("StreamEvents encountered unexpected error: %+v", err)

go/logic/coordinator_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,6 @@ func TestCoordinator(t *testing.T) {
110110
err = applier.CreateChangelogTable()
111111
require.NoError(t, err)
112112

113-
// ctx, cancel := context.WithCancel(context.Background())
114-
115113
for i := 0; i < 100; i++ {
116114
tx, err := db.Begin()
117115
require.NoError(t, err)
@@ -146,6 +144,10 @@ func TestCoordinator(t *testing.T) {
146144
return nil
147145
})
148146
coord.applier = applier
147+
coord.currentCoordinates = mysql.BinlogCoordinates{
148+
LogFile: "binlog.000001",
149+
LogPos: int64(4),
150+
}
149151
coord.InitializeWorkers(8)
150152

151153
streamCtx, cancelStreaming := context.WithCancel(context.Background())

0 commit comments

Comments
 (0)