Skip to content

Commit 6747b58

Browse files
author
Aaron Schlesinger
committed
fix(pkg/gitreceive/storage/object_test.go): adjust min number of calls to the statter
technically it should always be called three times, but the time of the call may cause the ticker to tick after the timer receives (and the wait call bails out). it’s guaranteed to call once, however.
1 parent cdf8ace commit 6747b58

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

pkg/gitreceive/storage/object_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,11 @@ func TestWaitForObjectMissing(t *testing.T) {
9191
err := WaitForObject(statter, bucketName, objKey, 1*time.Millisecond, 2*time.Millisecond)
9292
assert.True(t, err != nil, "no error received when there should have been")
9393
// it should make 1 call immediately, then calls at 1ms and 2ms
94-
assert.True(t, len(statter.Calls) >= 3, "the statter wasn't called at least once")
94+
assert.True(
95+
t,
96+
len(statter.Calls) >= 1,
97+
"the statter was not called, but should have been called at least once",
98+
)
9599
}
96100

97101
func TestWaitForObjectExists(t *testing.T) {

0 commit comments

Comments
 (0)