Skip to content

Commit fba4eba

Browse files
prestonvasquezblink1073
authored andcommitted
GODRIVER-3292 Pass context to custom mtest monitor (mongodb#1721)
(cherry picked from commit cf3f4a0)
1 parent 6f3105a commit fba4eba

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

internal/integration/mtest/mongotest.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -641,25 +641,25 @@ func (t *T) createTestClient() {
641641
// Setup command monitor
642642
var customMonitor = args.Monitor
643643
clientOpts.SetMonitor(&event.CommandMonitor{
644-
Started: func(_ context.Context, cse *event.CommandStartedEvent) {
644+
Started: func(ctx context.Context, cse *event.CommandStartedEvent) {
645645
if customMonitor != nil && customMonitor.Started != nil {
646-
customMonitor.Started(context.Background(), cse)
646+
customMonitor.Started(ctx, cse)
647647
}
648648
t.monitorLock.Lock()
649649
defer t.monitorLock.Unlock()
650650
t.started = append(t.started, cse)
651651
},
652-
Succeeded: func(_ context.Context, cse *event.CommandSucceededEvent) {
652+
Succeeded: func(ctx context.Context, cse *event.CommandSucceededEvent) {
653653
if customMonitor != nil && customMonitor.Succeeded != nil {
654-
customMonitor.Succeeded(context.Background(), cse)
654+
customMonitor.Succeeded(ctx, cse)
655655
}
656656
t.monitorLock.Lock()
657657
defer t.monitorLock.Unlock()
658658
t.succeeded = append(t.succeeded, cse)
659659
},
660-
Failed: func(_ context.Context, cfe *event.CommandFailedEvent) {
660+
Failed: func(ctx context.Context, cfe *event.CommandFailedEvent) {
661661
if customMonitor != nil && customMonitor.Failed != nil {
662-
customMonitor.Failed(context.Background(), cfe)
662+
customMonitor.Failed(ctx, cfe)
663663
}
664664
t.monitorLock.Lock()
665665
defer t.monitorLock.Unlock()

0 commit comments

Comments
 (0)