Skip to content

Commit

Permalink
[chore] Force require.EventuallyWithT to fail properly (open-telemetr…
Browse files Browse the repository at this point in the history
…y#35032)

I noticed on open-telemetry#34720 and open-telemetry#35026 that execution of the test continued
beyond a failure of `require.EventuallyWithT`. Based on the description
alone, I would expect that using `assert` within
`require.EventuallyWithT` should cause execution to stop if the
assertion fails, but it appears this may not be the case. However, this
change apparently works as intended.
  • Loading branch information
djaglowski authored and jriguera committed Oct 4, 2024
1 parent ca66b71 commit 4c77b09
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion receiver/windowseventlogreceiver/receiver_windows_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ func requireExpectedLogRecords(t *testing.T, sink *consumertest.LogsSink, expect
// logs sometimes take a while to be written, so a substantial wait buffer is needed
require.EventuallyWithT(t, func(c *assert.CollectT) {
actualLogRecords = filterAllLogRecordsBySource(t, sink, expectedEventSrc)
assert.Len(c, actualLogRecords, expectedEventCount)
require.Len(c, actualLogRecords, expectedEventCount)
}, 10*time.Second, 250*time.Millisecond)

return actualLogRecords
Expand Down

0 comments on commit 4c77b09

Please sign in to comment.