mirror of
https://github.com/niusmallnan/steve.git
synced 2025-04-27 19:06:05 +00:00
Fix resource counts unit tests
Increase the timeout slightly to avoid the occasional premature timeout. Fix error message typo.
This commit is contained in:
parent
73d389298c
commit
9a386b205c
@ -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())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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())
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user