From: Tom Clegg Date: Wed, 22 Jun 2022 13:56:18 +0000 (-0400) Subject: 19166: Account for auto-retry in integration test. X-Git-Tag: 2.5.0~106^2~14 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/c4bae86d39f237df8ac6a5505323f6a93011514a 19166: Account for auto-retry in integration test. Arvados-DCO-1.1-Signed-off-by: Tom Clegg --- diff --git a/lib/controller/integration_test.go b/lib/controller/integration_test.go index 67d60197e7..65d34315a5 100644 --- a/lib/controller/integration_test.go +++ b/lib/controller/integration_test.go @@ -1189,15 +1189,21 @@ func (s *IntegrationSuite) runContainer(c *check.C, clusterID string, ctrSpec ma deadline := time.Now().Add(time.Minute) wait: for ; ; lastState = ctr.State { + if time.Now().After(deadline) { + c.Errorf("timed out, container request state is %q", cr.State) + showlogs(ctr.Log) + c.FailNow() + } err = ac.RequestAndDecode(&ctr, "GET", "/arvados/v1/containers/"+cr.ContainerUUID, nil, nil) - c.Assert(err, check.IsNil) + if err != nil { + // container req is being auto-retried with a new container uuid + ac.RequestAndDecode(&cr, "GET", "/arvados/v1/container_requests/"+cr.UUID, nil, nil) + c.Assert(err, check.IsNil) + time.Sleep(time.Second / 2) + continue + } switch ctr.State { case lastState: - if time.Now().After(deadline) { - c.Errorf("timed out, container request state is %q", cr.State) - showlogs(ctr.Log) - c.FailNow() - } time.Sleep(time.Second / 2) case arvados.ContainerStateComplete: break wait