Skip to content

Commit

Permalink
Make core/wait tests more consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
Henrique Santos committed Nov 16, 2023
1 parent b354c88 commit 8b56123
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions core/wait/wait_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ func TestWaitWithContext(t *testing.T) {
checkFnWaitSucceeds: true,
checkFnNumberCallsUntilErr: 999999,
handlerSleepBeforeWait: 0,
handlerThrottle: 30 * time.Millisecond,
handlerThrottle: 40 * time.Millisecond,
handlerTimeout: 100 * time.Millisecond,
handlerTempErrRetryLimit: 0,
contextTimeout: 100 * time.Millisecond,
Expand All @@ -210,15 +210,15 @@ func TestWaitWithContext(t *testing.T) {
},
{
desc: "throttle",
checkFnNumberCallsToFinishWait: 3,
checkFnNumberCallsToFinishWait: 2,
checkFnWaitSucceeds: true,
checkFnNumberCallsUntilErr: 999999,
handlerSleepBeforeWait: 0,
handlerThrottle: 30 * time.Millisecond,
handlerThrottle: 40 * time.Millisecond,
handlerTimeout: 100 * time.Millisecond,
handlerTempErrRetryLimit: 0,
contextTimeout: 100 * time.Millisecond,
wantCheckFnNumberCalls: 3,
wantCheckFnNumberCalls: 2,
wantErr: false,
},
{
Expand All @@ -227,11 +227,11 @@ func TestWaitWithContext(t *testing.T) {
checkFnWaitSucceeds: true,
checkFnNumberCallsUntilErr: 999999,
handlerSleepBeforeWait: 0,
handlerThrottle: 30 * time.Millisecond,
handlerThrottle: 40 * time.Millisecond,
handlerTimeout: 100 * time.Millisecond,
handlerTempErrRetryLimit: 0,
contextTimeout: 1000 * time.Millisecond,
wantCheckFnNumberCalls: 4,
wantCheckFnNumberCalls: 3,
wantErr: true,
},
{
Expand All @@ -240,20 +240,20 @@ func TestWaitWithContext(t *testing.T) {
checkFnWaitSucceeds: true,
checkFnNumberCallsUntilErr: 999999,
handlerSleepBeforeWait: 0,
handlerThrottle: 30 * time.Millisecond,
handlerThrottle: 40 * time.Millisecond,
handlerTimeout: 1000 * time.Millisecond,
handlerTempErrRetryLimit: 0,
contextTimeout: 100 * time.Millisecond,
wantCheckFnNumberCalls: 4,
wantCheckFnNumberCalls: 3,
wantErr: true,
},
{
desc: "set_sleep_before_wait_and_throttle",
checkFnNumberCallsToFinishWait: 999999,
checkFnWaitSucceeds: true,
checkFnNumberCallsUntilErr: 999999,
handlerSleepBeforeWait: 60 * time.Millisecond,
handlerThrottle: 30 * time.Millisecond,
handlerSleepBeforeWait: 30 * time.Millisecond,
handlerThrottle: 40 * time.Millisecond,
handlerTimeout: 100 * time.Millisecond,
handlerTempErrRetryLimit: 0,
contextTimeout: 100 * time.Millisecond,
Expand All @@ -266,7 +266,7 @@ func TestWaitWithContext(t *testing.T) {
checkFnWaitSucceeds: true,
checkFnNumberCallsUntilErr: 999999,
handlerSleepBeforeWait: 200 * time.Millisecond,
handlerThrottle: 30 * time.Millisecond,
handlerThrottle: 40 * time.Millisecond,
handlerTimeout: 100 * time.Millisecond,
handlerTempErrRetryLimit: 0,
contextTimeout: 1000 * time.Millisecond,
Expand All @@ -279,7 +279,7 @@ func TestWaitWithContext(t *testing.T) {
checkFnWaitSucceeds: true,
checkFnNumberCallsUntilErr: 999999,
handlerSleepBeforeWait: 200 * time.Millisecond,
handlerThrottle: 30 * time.Millisecond,
handlerThrottle: 40 * time.Millisecond,
handlerTimeout: 1000 * time.Millisecond,
handlerTempErrRetryLimit: 0,
contextTimeout: 100 * time.Millisecond,
Expand All @@ -293,7 +293,7 @@ func TestWaitWithContext(t *testing.T) {
checkFnNumberCallsUntilErr: 0,
checkFnReturnsTempErr: false,
handlerSleepBeforeWait: 0,
handlerThrottle: 30 * time.Millisecond,
handlerThrottle: 40 * time.Millisecond,
handlerTimeout: 1000 * time.Millisecond,
handlerTempErrRetryLimit: 5,
contextTimeout: 1000 * time.Millisecond,
Expand All @@ -307,7 +307,7 @@ func TestWaitWithContext(t *testing.T) {
checkFnNumberCallsUntilErr: 1,
checkFnReturnsTempErr: true,
handlerSleepBeforeWait: 0,
handlerThrottle: 30 * time.Millisecond,
handlerThrottle: 40 * time.Millisecond,
handlerTimeout: 1000 * time.Millisecond,
handlerTempErrRetryLimit: 5,
contextTimeout: 1000 * time.Millisecond,
Expand All @@ -321,7 +321,7 @@ func TestWaitWithContext(t *testing.T) {
checkFnNumberCallsUntilErr: 1,
checkFnReturnsTempErr: true,
handlerSleepBeforeWait: 0,
handlerThrottle: 30 * time.Millisecond,
handlerThrottle: 40 * time.Millisecond,
handlerTimeout: 1000 * time.Millisecond,
handlerTempErrRetryLimit: 5,
contextTimeout: 1000 * time.Millisecond,
Expand Down

0 comments on commit 8b56123

Please sign in to comment.