@@ -36,7 +36,7 @@ import (
36
36
)
37
37
38
38
func TestCDCIterator_New (t * testing.T ) {
39
- ctx := context . Background ( )
39
+ ctx := test . Context ( t )
40
40
pool := test .ConnectPool (ctx , t , test .RepmgrConnString )
41
41
42
42
tests := []struct {
@@ -120,7 +120,7 @@ func TestCDCIterator_New(t *testing.T) {
120
120
}
121
121
122
122
func TestCDCIterator_Next (t * testing.T ) {
123
- ctx := context . Background ( )
123
+ ctx := test . Context ( t )
124
124
is := is .New (t )
125
125
126
126
pool := test .ConnectPool (ctx , t , test .RepmgrConnString )
@@ -342,7 +342,7 @@ func TestCDCIterator_Next(t *testing.T) {
342
342
}
343
343
344
344
func TestCDCIterator_Next_Fail (t * testing.T ) {
345
- ctx := context . Background ( )
345
+ ctx := test . Context ( t )
346
346
347
347
pool := test .ConnectPool (ctx , t , test .RepmgrConnString )
348
348
table := test .SetupTestTable (ctx , t , pool )
@@ -376,7 +376,7 @@ func TestCDCIterator_Next_Fail(t *testing.T) {
376
376
}
377
377
378
378
func TestCDCIterator_EnsureLSN (t * testing.T ) {
379
- ctx := context . Background ( )
379
+ ctx := test . Context ( t )
380
380
is := is .New (t )
381
381
382
382
pool := test .ConnectPool (ctx , t , test .RepmgrConnString )
@@ -416,7 +416,7 @@ func TestCDCIterator_EnsureLSN(t *testing.T) {
416
416
}
417
417
418
418
func TestCDCIterator_Ack (t * testing.T ) {
419
- ctx := context . Background ( )
419
+ ctx := test . Context ( t )
420
420
421
421
tests := []struct {
422
422
name string
@@ -501,7 +501,8 @@ func testCDCIterator(ctx context.Context, t *testing.T, pool *pgxpool.Pool, tabl
501
501
func fetchSlotStats (t * testing.T , c test.Querier , slotName string ) (pglogrepl.LSN , pglogrepl.LSN , error ) {
502
502
t .Helper ()
503
503
504
- ctx , cancel := context .WithTimeout (context .Background (), time .Second * 15 )
504
+ ctx := test .Context (t )
505
+ ctx , cancel := context .WithTimeout (ctx , time .Second * 15 )
505
506
defer cancel ()
506
507
507
508
var writeLSN , flushLSN pglogrepl.LSN
@@ -522,7 +523,7 @@ func fetchSlotStats(t *testing.T, c test.Querier, slotName string) (pglogrepl.LS
522
523
}
523
524
524
525
func TestCDCIterator_Schema (t * testing.T ) {
525
- ctx := context . Background ( )
526
+ ctx := test . Context ( t )
526
527
527
528
pool := test .ConnectPool (ctx , t , test .RepmgrConnString )
528
529
table := test .SetupTestTable (ctx , t , pool )
0 commit comments