Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ea5efbd

Browse files
authored
test: Fix flake with context.Cancelled in provisionerd (#386)
This occurred because the context can cancel in the same time a response is sent. This isn't a bug, because the complete still occurs.
1 parent fd5eceb commit ea5efbd

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

provisionerd/provisionerd_test.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -466,15 +466,13 @@ func TestProvisionerd(t *testing.T) {
466466
})
467467
require.NoError(t, err)
468468
<-shutdownCtx.Done()
469-
err = stream.Send(&sdkproto.Provision_Response{
469+
return stream.Send(&sdkproto.Provision_Response{
470470
Type: &sdkproto.Provision_Response_Complete{
471471
Complete: &sdkproto.Provision_Complete{
472472
Error: "some error",
473473
},
474474
},
475475
})
476-
require.NoError(t, err)
477-
return nil
478476
},
479477
}),
480478
})

0 commit comments

Comments
 (0)