15942: Ensure container with no suitable type is never in queue.
authorTom Clegg <tom@tomclegg.ca>
Thu, 19 Dec 2019 14:23:01 +0000 (09:23 -0500)
committerTom Clegg <tom@tomclegg.ca>
Thu, 19 Dec 2019 14:23:01 +0000 (09:23 -0500)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@tomclegg.ca>

lib/dispatchcloud/container/queue_test.go

index 085e98a5f9de592889d1d389cef667818b97af6a..971fe9490d9daa81ef9c15138558f8e64590ee2f 100644 (file)
@@ -121,10 +121,18 @@ func (suite *IntegrationSuite) TestCancelIfNoInstanceType(c *check.C) {
        // will have state=Cancelled or just disappear from the queue.
        suite.waitfor(c, time.Second, func() bool {
                cq.Update()
+
+               // Container should never be added to queue
+               _, ok := cq.Get(arvadostest.QueuedContainerUUID)
+               c.Check(ok, check.Equals, false)
+
                err := client.RequestAndDecode(&ctr, "GET", "arvados/v1/containers/"+arvadostest.QueuedContainerUUID, nil, nil)
                return err == nil && ctr.State == arvados.ContainerStateCancelled
        })
        c.Check(ctr.RuntimeStatus["error"], check.Equals, `no suitable instance type`)
+
+       _, ok := cq.Get(arvadostest.QueuedContainerUUID)
+       c.Check(ok, check.Equals, false)
 }
 
 func (suite *IntegrationSuite) waitfor(c *check.C, timeout time.Duration, fn func() bool) {