Fix resource counts unit tests

Increase the timeout slightly to avoid the occasional premature timeout.
Fix error message typo.
This commit is contained in:
Colleen Murphy 2023-01-20 14:19:05 -08:00
parent 73d389298c
commit 9a386b205c
2 changed files with 3 additions and 3 deletions

View File

@ -64,7 +64,7 @@ func Test_countsBuffer(t *testing.T) {
}
// due to complexities of cycle calculation, give a slight delay for the event to actually stream
output, err := receiveWithTimeout(outputChannel, debounceDuration+time.Millisecond*1)
output, err := receiveWithTimeout(outputChannel, debounceDuration+time.Millisecond*10)
assert.NoError(t, err, "did not expect an error when receiving value from channel")
outputCount := output.Object.Object.(Count)
assert.Len(t, outputCount.Counts, test.numInputEvents)
@ -93,7 +93,7 @@ func receiveWithTimeout(input chan types.APIEvent, duration time.Duration) (*typ
case value := <-input:
return &value, nil
case <-time.After(duration):
return nil, fmt.Errorf("timeout error, no value recieved after %f seconds", duration.Seconds())
return nil, fmt.Errorf("timeout error, no value received after %f seconds", duration.Seconds())
}
}

View File

@ -177,7 +177,7 @@ func receiveWithTimeout(input chan types.APIEvent, duration time.Duration) (*typ
case value := <-input:
return &value, nil
case <-time.After(duration):
return nil, fmt.Errorf("timeout error, no value recieved after %f seconds", duration.Seconds())
return nil, fmt.Errorf("timeout error, no value received after %f seconds", duration.Seconds())
}
}