mirror of
https://github.com/coder/coder.git
synced 2025-07-13 21:36:50 +00:00
fix: Always output job failure reason in provisioner daemon tests (#2850)
This flake can be seen here: https://github.com/coder/coder/runs/7186604615?check_suite_focus=true
This commit is contained in:
@ -962,6 +962,14 @@ func createProvisionerd(t *testing.T, dialer provisionerd.Dialer, provisioners p
|
||||
// Creates a provisionerd protobuf client that's connected
|
||||
// to the server implementation provided.
|
||||
func createProvisionerDaemonClient(t *testing.T, server provisionerDaemonTestServer) proto.DRPCProvisionerDaemonClient {
|
||||
if server.failJob == nil {
|
||||
// Default to asserting the error from the failure, otherwise
|
||||
// it can be lost in tests!
|
||||
server.failJob = func(ctx context.Context, job *proto.FailedJob) (*proto.Empty, error) {
|
||||
assert.Fail(t, job.Error)
|
||||
return &proto.Empty{}, nil
|
||||
}
|
||||
}
|
||||
clientPipe, serverPipe := provisionersdk.TransportPipe()
|
||||
t.Cleanup(func() {
|
||||
_ = clientPipe.Close()
|
||||
|
Reference in New Issue
Block a user