Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions mongo/integration/mtest/mongotest.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,11 +278,9 @@ func (t *T) ClearMockResponses() {
t.mockDeployment.clearResponses()
}

// GetStartedEvent returns the most recent CommandStartedEvent, or nil if one is not present.
// GetStartedEvent returns the least recent CommandStartedEvent, or nil if one is not present.
// This can only be called once per event.
func (t *T) GetStartedEvent() *event.CommandStartedEvent {
// TODO(GODRIVER-2075): GetStartedEvent documents that it returns the most recent event, but actually returns the first
// TODO event. Update either the documentation or implementation.
if len(t.started) == 0 {
return nil
}
Expand All @@ -291,11 +289,9 @@ func (t *T) GetStartedEvent() *event.CommandStartedEvent {
return e
}

// GetSucceededEvent returns the most recent CommandSucceededEvent, or nil if one is not present.
// GetSucceededEvent returns the least recent CommandSucceededEvent, or nil if one is not present.
// This can only be called once per event.
func (t *T) GetSucceededEvent() *event.CommandSucceededEvent {
// TODO(GODRIVER-2075): GetSucceededEvent documents that it returns the most recent event, but actually returns the
// TODO first event. Update either the documentation or implementation.
if len(t.succeeded) == 0 {
return nil
}
Expand All @@ -304,11 +300,9 @@ func (t *T) GetSucceededEvent() *event.CommandSucceededEvent {
return e
}

// GetFailedEvent returns the most recent CommandFailedEvent, or nil if one is not present.
// GetFailedEvent returns the least recent CommandFailedEvent, or nil if one is not present.
// This can only be called once per event.
func (t *T) GetFailedEvent() *event.CommandFailedEvent {
// TODO(GODRIVER-2075): GetFailedEvent documents that it returns the most recent event, but actually returns the first
// TODO event. Update either the documentation or implementation.
if len(t.failed) == 0 {
return nil
}
Expand Down