Skip to content

Commit a1c1d0c

Browse files
committed
move NewEventRecorder
1 parent eece56a commit a1c1d0c

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

internal/verifier/check.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,6 @@ func (verifier *Verifier) CheckDriver(ctx context.Context, filter map[string]any
156156
verifier.phase = Idle
157157
}()
158158

159-
// A “throwaway” EventRecorder so that any change events that arrive
160-
// right away will have somewhere to be recorded.
161-
verifier.generationEventRecorder = NewEventRecorder()
162-
163159
verifier.mux.RLock()
164160
csRunning := verifier.changeStreamRunning
165161
verifier.mux.RUnlock()

internal/verifier/migration_verifier.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,10 @@ func NewVerifier(settings VerifierSettings) *Verifier {
199199
changeStreamErrChan: make(chan error),
200200
changeStreamDoneChan: make(chan struct{}),
201201
readConcernSetting: readConcern,
202+
203+
// This will get recreated once gen0 starts, but we want it
204+
// here in case the change streams gets an event before then.
205+
generationEventRecorder: NewEventRecorder(),
202206
}
203207
}
204208

internal/verifier/migration_verifier_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func buildVerifier(t *testing.T, srcMongoInstance MongoInstance, dstMongoInstanc
5858
//verifier.SetStartClean(true)
5959
verifier.SetNumWorkers(3)
6060
verifier.SetGenerationPauseDelayMillis(0)
61-
//verifier.SetWorkerSleepDelayMillis(0)
61+
verifier.SetWorkerSleepDelayMillis(1000)
6262
require.Nil(t, verifier.SetMetaURI(context.Background(), "mongodb://localhost:"+metaMongoInstance.port))
6363
require.Nil(t, verifier.SetSrcURI(context.Background(), "mongodb://localhost:"+srcMongoInstance.port))
6464
require.Nil(t, verifier.SetDstURI(context.Background(), "mongodb://localhost:"+dstMongoInstance.port))

0 commit comments

Comments
 (0)