@@ -36,7 +36,7 @@ import (
3636)
3737
3838func TestCDCIterator_New (t * testing.T ) {
39- ctx := context . Background ( )
39+ ctx := test . Context ( t )
4040 pool := test .ConnectPool (ctx , t , test .RepmgrConnString )
4141
4242 tests := []struct {
@@ -120,7 +120,7 @@ func TestCDCIterator_New(t *testing.T) {
120120}
121121
122122func TestCDCIterator_Next (t * testing.T ) {
123- ctx := context . Background ( )
123+ ctx := test . Context ( t )
124124 is := is .New (t )
125125
126126 pool := test .ConnectPool (ctx , t , test .RepmgrConnString )
@@ -342,7 +342,7 @@ func TestCDCIterator_Next(t *testing.T) {
342342}
343343
344344func TestCDCIterator_Next_Fail (t * testing.T ) {
345- ctx := context . Background ( )
345+ ctx := test . Context ( t )
346346
347347 pool := test .ConnectPool (ctx , t , test .RepmgrConnString )
348348 table := test .SetupTestTable (ctx , t , pool )
@@ -376,7 +376,7 @@ func TestCDCIterator_Next_Fail(t *testing.T) {
376376}
377377
378378func TestCDCIterator_EnsureLSN (t * testing.T ) {
379- ctx := context . Background ( )
379+ ctx := test . Context ( t )
380380 is := is .New (t )
381381
382382 pool := test .ConnectPool (ctx , t , test .RepmgrConnString )
@@ -416,7 +416,7 @@ func TestCDCIterator_EnsureLSN(t *testing.T) {
416416}
417417
418418func TestCDCIterator_Ack (t * testing.T ) {
419- ctx := context . Background ( )
419+ ctx := test . Context ( t )
420420
421421 tests := []struct {
422422 name string
@@ -501,7 +501,8 @@ func testCDCIterator(ctx context.Context, t *testing.T, pool *pgxpool.Pool, tabl
501501func fetchSlotStats (t * testing.T , c test.Querier , slotName string ) (pglogrepl.LSN , pglogrepl.LSN , error ) {
502502 t .Helper ()
503503
504- ctx , cancel := context .WithTimeout (context .Background (), time .Second * 15 )
504+ ctx := test .Context (t )
505+ ctx , cancel := context .WithTimeout (ctx , time .Second * 15 )
505506 defer cancel ()
506507
507508 var writeLSN , flushLSN pglogrepl.LSN
@@ -522,7 +523,7 @@ func fetchSlotStats(t *testing.T, c test.Querier, slotName string) (pglogrepl.LS
522523}
523524
524525func TestCDCIterator_Schema (t * testing.T ) {
525- ctx := context . Background ( )
526+ ctx := test . Context ( t )
526527
527528 pool := test .ConnectPool (ctx , t , test .RepmgrConnString )
528529 table := test .SetupTestTable (ctx , t , pool )
0 commit comments