Skip to content

Commit 8c2dc61

Browse files
author
Sarah Adams
committed
logging: check for exact # of logs in tests
Change-Id: I780f3d2793660ad7c9753966e7067e50e9df44ad Reviewed-on: https://code-review.googlesource.com/9031 Reviewed-by: Ross Light <light@google.com>
1 parent 4791784 commit 8c2dc61

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

logging/logging_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ func TestLogSync(t *testing.T) {
182182
t.Log("fetching log entries: ", err)
183183
return false
184184
}
185-
return len(got) >= len(want)
185+
return len(got) == len(want)
186186
})
187187
if !ok {
188188
t.Fatalf("timed out; got: %d, want: %d\n", len(got), len(want))
@@ -219,7 +219,7 @@ func TestLogAndEntries(t *testing.T) {
219219
t.Log("fetching log entries: ", err)
220220
return false
221221
}
222-
return len(got) >= len(want)
222+
return len(got) == len(want)
223223
})
224224
if !ok {
225225
t.Fatalf("timed out; got: %d, want: %d\n", len(got), len(want))
@@ -318,7 +318,7 @@ func TestStandardLogger(t *testing.T) {
318318
t.Log("fetching log entries: ", err)
319319
return false
320320
}
321-
return len(got) >= 1
321+
return len(got) == 1
322322
})
323323
if !ok {
324324
t.Fatalf("timed out; got: %d, want: %d\n", len(got), 1)

0 commit comments

Comments
 (0)