kvdb/etcd: remove context.TODO() from test helpers

We want `context.TODO()` to be high signal in the code-base. It should
signal clearly that work is required to thread parent context through to
the call-site. So to keep the signal-to-noise ratio high, we remove any
context.TODO() calls from tests since these will never need to be
replace by a parent context.

After this commit, there is only a single context.TODO() left in the
code-base.
This commit is contained in:
Elle Mouton
2025-04-07 10:49:41 +02:00
parent dd5c6d16e3
commit 6ff0c85d76
5 changed files with 15 additions and 9 deletions

View File

@@ -16,7 +16,7 @@ func TestChangeDuringManualTx(t *testing.T) {
f := NewEtcdTestFixture(t)
db, err := newEtcdBackend(context.TODO(), f.BackendConfig())
db, err := newEtcdBackend(context.Background(), f.BackendConfig())
require.NoError(t, err)
tx, err := db.BeginReadWriteTx()
@@ -44,7 +44,7 @@ func TestChangeDuringUpdate(t *testing.T) {
f := NewEtcdTestFixture(t)
db, err := newEtcdBackend(context.TODO(), f.BackendConfig())
db, err := newEtcdBackend(context.Background(), f.BackendConfig())
require.NoError(t, err)
count := 0