@@ -24,7 +24,7 @@ func TestLaunch(t *testing.T) {
2424
2525 eg , _ := errgroup .WithContext (ctx )
2626 eg .Go (func () error {
27- _ , err := adapter .Start (ctx , conn )
27+ _ , err := adapter .Start (conn )
2828 assert .NoError (t , err )
2929 return nil
3030 })
@@ -57,13 +57,13 @@ func TestLaunch(t *testing.T) {
5757 // We should have received the initialized event.
5858 select {
5959 case <- initialized :
60- default :
60+ case <- ctx . Done () :
6161 assert .Fail (t , "did not receive initialized event" )
6262 }
6363
6464 select {
6565 case <- configurationDone :
66- case <- time . After ( 10 * time . Second ):
66+ case <- ctx . Done ( ):
6767 assert .Fail (t , "did not receive configurationDone response" )
6868 }
6969 return nil
@@ -82,7 +82,7 @@ func TestSetBreakpoints(t *testing.T) {
8282
8383 eg , _ := errgroup .WithContext (ctx )
8484 eg .Go (func () error {
85- _ , err := adapter .Start (ctx , conn )
85+ _ , err := adapter .Start (conn )
8686 assert .NoError (t , err )
8787 return nil
8888 })
@@ -118,7 +118,7 @@ func TestSetBreakpoints(t *testing.T) {
118118 // We should have received the initialized event.
119119 select {
120120 case <- initialized :
121- default :
121+ case <- ctx . Done () :
122122 assert .Fail (t , "did not receive initialized event" )
123123 }
124124
@@ -127,7 +127,7 @@ func TestSetBreakpoints(t *testing.T) {
127127 assert .True (t , setBreakpointsResp .Success )
128128 assert .Len (t , setBreakpointsResp .Body .Breakpoints , 0 )
129129 assert .NotNil (t , setBreakpointsResp .Body .Breakpoints , "breakpoints should be an empty array instead of null in the JSON" )
130- case <- time . After ( 10 * time . Second ):
130+ case <- ctx . Done ( ):
131131 assert .Fail (t , "did not receive setBreakpoints response" )
132132 }
133133 return nil
@@ -249,11 +249,11 @@ func NewTestAdapter[C LaunchConfig](t *testing.T) (*Adapter[C], Conn, *daptest.C
249249 t .Cleanup (func () { clientConn .Close () })
250250
251251 adapter := New [C ]()
252- t .Cleanup (func () { adapter .Stop () })
253252
254253 client := daptest .NewClient (clientConn )
255254 t .Cleanup (func () { client .Close () })
256255
256+ t .Cleanup (func () { adapter .Stop () })
257257 return adapter , srvConn , client
258258}
259259
0 commit comments