[ARVADOS] updated: 1.3.0-1999-gd01a136c6

Git user git at public.arvados.org
Sat Dec 21 22:08:17 UTC 2019


Summary of changes:
 lib/dispatchcloud/container/queue_test.go | 25 +++++++++++++++++--------
 1 file changed, 17 insertions(+), 8 deletions(-)

       via  d01a136c64bb5e342542b7de4da45e09e0961dc1 (commit)
      from  ef48a49d302ca25136bbb2ed96319a8b56b46250 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit d01a136c64bb5e342542b7de4da45e09e0961dc1
Author: Tom Clegg <tom at tomclegg.ca>
Date:   Sat Dec 21 17:07:12 2019 -0500

    15942: Update test to fail more reliably when bug reappears.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at tomclegg.ca>

diff --git a/lib/dispatchcloud/container/queue_test.go b/lib/dispatchcloud/container/queue_test.go
index 971fe9490..3e1cd5061 100644
--- a/lib/dispatchcloud/container/queue_test.go
+++ b/lib/dispatchcloud/container/queue_test.go
@@ -112,6 +112,23 @@ func (suite *IntegrationSuite) TestCancelIfNoInstanceType(c *check.C) {
 	client := arvados.NewClientFromEnv()
 	cq := NewQueue(logger(), nil, errorTypeChooser, client)
 
+	ch := cq.Subscribe()
+	go func() {
+		defer cq.Unsubscribe(ch)
+		for range ch {
+			// Container should never be added to
+			// queue. Note that polling the queue this way
+			// doesn't guarantee a bug (container being
+			// incorrectly added to the queue) will cause
+			// a test failure.
+			_, ok := cq.Get(arvadostest.QueuedContainerUUID)
+			if !c.Check(ok, check.Equals, false) {
+				// Don't spam the log with more failures
+				break
+			}
+		}
+	}()
+
 	var ctr arvados.Container
 	err := client.RequestAndDecode(&ctr, "GET", "arvados/v1/containers/"+arvadostest.QueuedContainerUUID, nil, nil)
 	c.Check(err, check.IsNil)
@@ -121,18 +138,10 @@ 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) {

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list