@@ -1347,7 +1347,11 @@ func TestAPI(t *testing.T) {
13471347}
13481348return errTestTermination
13491349})
1350- testutil .RequireReceive (ctx ,t ,terminated )
1350+ select {
1351+ case <- ctx .Done ():
1352+ t .Fatal ("timeout waiting for agent termination" )
1353+ case <- terminated :
1354+ }
13511355
13521356t .Log ("Waiting for agent reinjection..." )
13531357
@@ -1371,7 +1375,11 @@ func TestAPI(t *testing.T) {
13711375assert .Fail (t ,`want "agent" command argument` )
13721376}
13731377close (agentStarted )
1374- <- continueTerminate
1378+ select {
1379+ case <- ctx .Done ():
1380+ t .Error ("timeout waiting for agent continueTerminate" )
1381+ case <- continueTerminate :
1382+ }
13751383return errTestTermination
13761384})
13771385
@@ -1429,7 +1437,11 @@ func TestAPI(t *testing.T) {
14291437
14301438// Terminate the running agent.
14311439close (continueTerminate )
1432- testutil .RequireReceive (ctx ,t ,terminated )
1440+ select {
1441+ case <- ctx .Done ():
1442+ t .Fatal ("timeout waiting for agent termination" )
1443+ case <- terminated :
1444+ }
14331445
14341446// Simulate the agent deletion (this happens because the
14351447// devcontainer configuration changed).