Skip to content

Commit

Permalink
Refactor require.Eventually to a one-liner for consistency
Browse files Browse the repository at this point in the history
Signed-off-by: Hemant <hkbiet@gmail.com>
  • Loading branch information
hkiiita committed Nov 5, 2024
1 parent 6c6e6f2 commit f939732
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pkg/agent/controller/networkpolicy/fqdn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -729,9 +729,7 @@ func TestOnDNSResponse(t *testing.T) {
if tc.expectedRequeryAfter != nil {
// Wait for the DelayingQueue to create the timer which signals that the
// DNS request for the FQDN item is ready to be sent.
require.Eventually(t, func() bool {
return fakeClock.TimersAdded() > 0
}, 1*time.Second, 10*time.Millisecond)
require.Eventually(t, func() bool { return fakeClock.TimersAdded() > 0 }, 1*time.Second, 10*time.Millisecond)

fakeClock.Step(*tc.expectedRequeryAfter)
// needed to avoid blocking on Get() in case of failure
Expand Down

0 comments on commit f939732

Please sign in to comment.