@@ -216,7 +216,7 @@ func TestBuildProvider(t *testing.T) {
216216 t .Run (tt .name , func (t * testing.T ) {
217217 domainFilter := endpoint .NewDomainFilter ([]string {"example.com" })
218218
219- p , err := buildProvider (context . Background (), tt .cfg , domainFilter )
219+ p , err := buildProvider (t . Context (), tt .cfg , domainFilter )
220220
221221 if tt .expectedError != "" {
222222 assert .Error (t , err )
@@ -292,7 +292,7 @@ func TestBuildSourceWithWrappers(t *testing.T) {
292292
293293 for _ , tt := range tests {
294294 t .Run (tt .name , func (t * testing.T ) {
295- _ , err := buildSource (context . Background (), source .NewSourceConfig (tt .cfg ))
295+ _ , err := buildSource (t . Context (), source .NewSourceConfig (tt .cfg ))
296296 require .NoError (t , err )
297297 })
298298 }
@@ -323,7 +323,7 @@ func TestHelperProcess(t *testing.T) {
323323func runExecuteSubprocess (t * testing.T , args []string ) (int , string , error ) {
324324 t .Helper ()
325325 // make sure the subprocess does not run forever
326- ctx , cancel := context .WithTimeout (context . Background (), 10 * time .Second )
326+ ctx , cancel := context .WithTimeout (t . Context (), 10 * time .Second )
327327 defer cancel ()
328328
329329 cmdArgs := append ([]string {"-test.run=TestHelperProcess" , "--" }, args ... )
@@ -470,7 +470,7 @@ func TestControllerRunCancelContextStopsLoop(t *testing.T) {
470470 Registry : "txt" ,
471471 TXTOwnerID : "test-owner" ,
472472 }
473- ctx , cancel := context .WithCancel (context . Background ())
473+ ctx , cancel := context .WithCancel (t . Context ())
474474 defer cancel ()
475475 src , err := buildSource (ctx , source .NewSourceConfig (cfg ))
476476 require .NoError (t , err )
0 commit comments