X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/623ffe7320d0a159ba9a5912fc1948cac12ad505..b38ee1ddd208d40c236361536639c811787aaea2:/lib/dispatchcloud/worker/worker_test.go diff --git a/lib/dispatchcloud/worker/worker_test.go b/lib/dispatchcloud/worker/worker_test.go index 2ee6b7c362..5d8c67e916 100644 --- a/lib/dispatchcloud/worker/worker_test.go +++ b/lib/dispatchcloud/worker/worker_test.go @@ -43,7 +43,7 @@ func (suite *WorkerSuite) TestProbeAndUpdate(c *check.C) { probeTimeout := time.Second ac := arvados.NewClientFromEnv() - is, err := (&test.StubDriver{}).InstanceSet(nil, "test-instance-set-id", nil, suite.logger) + is, err := (&test.StubDriver{}).InstanceSet(nil, "test-instance-set-id", nil, suite.logger, nil) c.Assert(err, check.IsNil) inst, err := is.Create(arvados.InstanceType{}, "", nil, "echo InitCommand", nil) c.Assert(err, check.IsNil) @@ -122,6 +122,39 @@ func (suite *WorkerSuite) TestProbeAndUpdate(c *check.C) { expectState: StateUnknown, expectRunning: 1, }, + { + testCaseComment: "Unknown, boot probe fails, deployRunner succeeds, container is running", + state: StateUnknown, + respBoot: respFail, + respRun: respFail, + respRunDeployed: respContainerRunning, + deployRunner: []byte("ELF"), + expectStdin: []byte("ELF"), + expectState: StateUnknown, + expectRunning: 1, + }, + { + testCaseComment: "Unknown, boot timeout exceeded, boot probe fails but deployRunner succeeds and container is running", + state: StateUnknown, + age: bootTimeout * 2, + respBoot: respFail, + respRun: respFail, + respRunDeployed: respContainerRunning, + deployRunner: []byte("ELF"), + expectStdin: []byte("ELF"), + expectState: StateUnknown, + expectRunning: 1, + }, + { + testCaseComment: "Unknown, boot timeout exceeded, boot probe fails but deployRunner succeeds and no container is running", + state: StateUnknown, + age: bootTimeout * 2, + respBoot: respFail, + respRun: respFail, + deployRunner: []byte("ELF"), + expectStdin: []byte("ELF"), + expectState: StateShutdown, + }, { testCaseComment: "Booting, boot probe fails, run probe fails", state: StateBooting,