From 21d4c1b9f32bf26538206c38c406b3074be63687 Mon Sep 17 00:00:00 2001 From: Zygmunt Krynicki Date: Tue, 4 Apr 2017 16:56:32 +0200 Subject: [PATCH] overlord: increase prune test wait by x10 We are seeing many failures that involve the TestEnsureLoopPrune test. This test is inherently racy as it uses a actual time to wait for something to happen. In case the machine is loaded heavily and other processes contend for resources it may not get scheduled in time for this to happen. While the fix is not perfect I hope to at least decrease the frequency of the failures. We may investigate a more correct fix where timing would no longer be a factor if this is deemed insufficient. Signed-off-by: Zygmunt Krynicki --- overlord/overlord_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/overlord/overlord_test.go b/overlord/overlord_test.go index a010c02ea1e..c3b3385bb93 100644 --- a/overlord/overlord_test.go +++ b/overlord/overlord_test.go @@ -374,7 +374,7 @@ func (ovs *overlordSuite) TestEnsureLoopPrune(c *C) { markSeeded(o) o.Loop() - time.Sleep(150 * time.Millisecond) + time.Sleep(1500 * time.Millisecond) err = o.Stop() c.Assert(err, IsNil) @@ -412,7 +412,7 @@ func (ovs *overlordSuite) TestEnsureLoopPruneRunsMultipleTimes(c *C) { o.Loop() // ensure the first change is pruned - time.Sleep(150 * time.Millisecond) + time.Sleep(1500 * time.Millisecond) st.Lock() c.Check(st.Changes(), HasLen, 1) st.Unlock() @@ -421,7 +421,7 @@ func (ovs *overlordSuite) TestEnsureLoopPruneRunsMultipleTimes(c *C) { st.Lock() chg2.SetStatus(state.DoneStatus) st.Unlock() - time.Sleep(150 * time.Millisecond) + time.Sleep(1500 * time.Millisecond) st.Lock() c.Check(st.Changes(), HasLen, 0) st.Unlock()