From a64f4610abb2ea84346301392695198c30ec1581 Mon Sep 17 00:00:00 2001 From: Boris Nagaev Date: Fri, 21 Feb 2025 20:48:56 -0300 Subject: [PATCH] sweepbatcher: fix usage of EventuallyWithT It should use the c variable passed into the lambda, not the parent t. It should use assert, not require package. --- sweepbatcher/sweep_batcher_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sweepbatcher/sweep_batcher_test.go b/sweepbatcher/sweep_batcher_test.go index fbfb0d41..d861a5b2 100644 --- a/sweepbatcher/sweep_batcher_test.go +++ b/sweepbatcher/sweep_batcher_test.go @@ -950,7 +950,7 @@ func testDelays(t *testing.T, store testStore, batcherStore testBatcherStore) { // Wait for batch publishing to be skipped, because initialDelay has not // ended. require.EventuallyWithT(t, func(c *assert.CollectT) { - require.Contains(t, testLogger.debugMessages, stillWaitingMsg) + assert.Contains(c, testLogger.debugMessages, stillWaitingMsg) }, test.Timeout, eventuallyCheckFrequency) // Advance the clock to the end of initialDelay. @@ -1274,7 +1274,7 @@ func testDelays(t *testing.T, store testStore, batcherStore testBatcherStore) { // Wait for sweep to be added to the batch. require.EventuallyWithT(t, func(c *assert.CollectT) { - require.Contains(t, testLogger2.infoMessages, "adding sweep %x") + assert.Contains(c, testLogger2.infoMessages, "adding sweep %x") }, test.Timeout, eventuallyCheckFrequency) // Advance the clock by publishDelay. Don't wait largeInitialDelay.