Replace context.Background with testing.TB.Context where possible (#15416)

* Replace context.Background with testing.TB.Context where possible

* Fix failing tests
This commit is contained in:
Preston Van Loon
2025-06-16 17:09:18 -05:00
committed by GitHub
parent 6a13ba9125
commit 62fec4d1f3
409 changed files with 3175 additions and 3456 deletions

View File

@@ -35,7 +35,7 @@ func TestWaitUntilReady(t *testing.T) {
}
// retries counter and timestamp are set when we mark the batch for sequencing, if it is in the retry state
b = b.withState(batchSequenced)
require.ErrorIs(t, b.waitUntilReady(context.Background()), errDerp)
require.ErrorIs(t, b.waitUntilReady(t.Context()), errDerp)
require.Equal(t, true, retryDelay-time.Until(b.retryAfter) < time.Millisecond)
require.Equal(t, true, got < retryDelay && got > retryDelay-time.Millisecond)
require.Equal(t, 1, b.retries)