Skip to content

Commit

Permalink
overlord: increase prune test wait by x10
Browse files Browse the repository at this point in the history
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 <zygmunt.krynicki@canonical.com>
  • Loading branch information
zyga committed Apr 4, 2017
1 parent 98d20e7 commit 21d4c1b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions overlord/overlord_test.go
Expand Up @@ -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)

Expand Down Expand Up @@ -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()
Expand All @@ -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()
Expand Down

0 comments on commit 21d4c1b

Please sign in to comment.