Skip to content

Commit 725bc7c

Browse files
committed
fix error
1 parent f355d8e commit 725bc7c

File tree

3 files changed

+14
-18
lines changed

3 files changed

+14
-18
lines changed

internal/verifier/change_stream_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ func (suite *IntegrationTestSuite) TestEventBeforeWritesOff() {
275275
)
276276
suite.Require().NoError(err)
277277

278-
verifier.WritesOff(ctx)
278+
suite.Require().NoError(verifier.WritesOff(ctx))
279279

280280
verifierDone := false
281281
for !verifierDone {

internal/verifier/migration_verifier_test.go

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1381,28 +1381,20 @@ func (suite *IntegrationTestSuite) TestGenerationalRechecking() {
13811381
suite.Require().Equal(VerificationStatus{TotalTasks: 1, CompletedTasks: 1}, *status)
13821382

13831383
// turn writes off
1384-
verifier.WritesOff(ctx)
1384+
suite.Require().NoError(verifier.WritesOff(ctx))
1385+
1386+
// now write to the source, this should not be seen by the change stream which should have ended
1387+
// because of the calls to WritesOff
13851388
_, err = srcColl.InsertOne(ctx, bson.M{"_id": 1019, "x": 1019})
13861389
suite.Require().NoError(err)
13871390
checkContinueChan <- struct{}{}
13881391
<-checkDoneChan
1389-
// now write to the source, this should not be seen by the change stream which should have ended
1390-
// because of the calls to WritesOff
1392+
13911393
status, err = verifier.GetVerificationStatus()
13921394
suite.Require().NoError(err)
13931395

1394-
// there should be a failure from the src insert
1395-
suite.T().Logf("status: %+v", *status)
1396-
suite.Assert().Equal(VerificationStatus{TotalTasks: 1, FailedTasks: 1}, *status)
1397-
1398-
failedTasks, incompleteTasks, err := FetchFailedAndIncompleteTasks(
1399-
ctx,
1400-
verifier.verificationTaskCollection(),
1401-
verificationTaskVerifyDocuments,
1402-
verifier.generation,
1403-
)
1404-
suite.T().Logf("failed: %+v", failedTasks)
1405-
suite.T().Logf("incomplete: %+v", incompleteTasks)
1396+
// there should be a no more tasks
1397+
suite.Assert().Equal(VerificationStatus{}, *status)
14061398

14071399
checkContinueChan <- struct{}{}
14081400
require.NoError(suite.T(), errGroup.Wait())
@@ -1523,7 +1515,7 @@ func (suite *IntegrationTestSuite) TestVerifierWithFilter() {
15231515
suite.Require().Equal(VerificationStatus{TotalTasks: 1, CompletedTasks: 1}, *status)
15241516

15251517
// Turn writes off.
1526-
verifier.WritesOff(ctx)
1518+
suite.Require().NoError(verifier.WritesOff(ctx))
15271519

15281520
// Tell CheckDriver to do one more pass. This should terminate the change stream.
15291521
checkContinueChan <- struct{}{}

main/migration_verifier.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,11 @@ func main() {
176176
zerolog.SetGlobalLevel(zerolog.DebugLevel)
177177
}
178178
if cCtx.Bool(checkOnly) {
179-
verifier.WritesOff(ctx)
179+
err := verifier.WritesOff(ctx)
180+
if err != nil {
181+
return errors.Wrap(err, "failed to set writes off")
182+
}
183+
180184
return verifier.CheckDriver(ctx, nil)
181185
} else {
182186
return verifier.StartServer()

0 commit comments

Comments
 (0)