Skip to content

Commit

Permalink
Ensure ErrorResponse is cleared between PollForErrorResponse runs
Browse files Browse the repository at this point in the history
  • Loading branch information
grddev committed Mar 6, 2024
1 parent c03ed22 commit 427477a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 2 additions & 0 deletions archive/control.go
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,8 @@ func (control *Control) PollForErrorResponse() (int, error) {
context := PollContext{control, 0}
received := 0

control.Results.ErrorResponse = nil

// Poll for async events, errors etc until the queue is drained
for {
ret := control.poll(
Expand Down
1 change: 0 additions & 1 deletion archive/control_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ func TestControl_PollForErrorResponse(t *testing.T) {
cnt, err := control.PollForErrorResponse()
assert.EqualValues(t, 1, cnt)
assert.Error(t, err)
control.Results.ErrorResponse = nil // TODO: Should this really be necessary?
cnt, err = control.PollForErrorResponse()
assert.EqualValues(t, 1, cnt)
assert.NoError(t, err)
Expand Down

0 comments on commit 427477a

Please sign in to comment.