X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/71fd4da18b22100682ae7e2079aadfd66360d310..3c87946740b83f612561f998f7d83586593be830:/lib/dispatchcloud/container/queue_test.go diff --git a/lib/dispatchcloud/container/queue_test.go b/lib/dispatchcloud/container/queue_test.go index 91d65359e8..daf7977ad5 100644 --- a/lib/dispatchcloud/container/queue_test.go +++ b/lib/dispatchcloud/container/queue_test.go @@ -74,6 +74,8 @@ func (suite *IntegrationSuite) TestGetLockUnlockCancel(c *check.C) { defer wg.Done() err := cq.Unlock(uuid) c.Check(err, check.NotNil) + c.Check(err, check.ErrorMatches, ".*cannot unlock when Queued*.") + err = cq.Lock(uuid) c.Check(err, check.IsNil) ctr, ok := cq.Get(uuid) @@ -81,6 +83,7 @@ func (suite *IntegrationSuite) TestGetLockUnlockCancel(c *check.C) { c.Check(ctr.State, check.Equals, arvados.ContainerStateLocked) err = cq.Lock(uuid) c.Check(err, check.NotNil) + err = cq.Unlock(uuid) c.Check(err, check.IsNil) ctr, ok = cq.Get(uuid) @@ -88,12 +91,17 @@ func (suite *IntegrationSuite) TestGetLockUnlockCancel(c *check.C) { c.Check(ctr.State, check.Equals, arvados.ContainerStateQueued) err = cq.Unlock(uuid) c.Check(err, check.NotNil) + + err = cq.Cancel(uuid) + c.Check(err, check.IsNil) + ctr, ok = cq.Get(uuid) + c.Check(ok, check.Equals, true) + c.Check(ctr.State, check.Equals, arvados.ContainerStateCancelled) + err = cq.Lock(uuid) + c.Check(err, check.NotNil) }() } wg.Wait() - - err = cq.Cancel(arvadostest.CompletedContainerUUID) - c.Check(err, check.ErrorMatches, `.*State cannot change from Complete to Cancelled.*`) } func (suite *IntegrationSuite) TestCancelIfNoInstanceType(c *check.C) {