X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/3b2568c566f7db8f56ba3425b21a4f7fcb46a083..f5fd7e2dc13b912e1032a54119f3fb60973f77e2:/lib/controller/rails_restart_test.go diff --git a/lib/controller/rails_restart_test.go b/lib/controller/rails_restart_test.go index bb307d3216..e3267c220f 100644 --- a/lib/controller/rails_restart_test.go +++ b/lib/controller/rails_restart_test.go @@ -75,15 +75,19 @@ func (s *railsRestartSuite) TestConfigReload(c *check.C) { // Wait for RailsAPI's 1 Hz reload_config thread to poll and // hit restart.txt - for deadline := time.Now().Add(10 * time.Second); time.Now().Before(deadline); time.Sleep(time.Second) { + pollstart := time.Now() + for deadline := time.Now().Add(20 * time.Second); time.Now().Before(deadline); time.Sleep(time.Second) { resp, err = hc.Do(req) c.Assert(err, check.IsNil) + defer resp.Body.Close() c.Check(resp.StatusCode, check.Equals, http.StatusOK) body, err = ioutil.ReadAll(resp.Body) c.Assert(err, check.IsNil) + resp.Body.Close() if strings.Contains(string(body), newhash) { break } } + c.Logf("waited %s for rails to restart", time.Now().Sub(pollstart)) c.Check(string(body), check.Matches, `(?ms).*`+newhash+`.*`) }