api: Fix clock waits in TestLaterPingFails #6420

Merged
merged 1 commit into from Oct 10, 2016

Conversation

Projects
None yet
4 participants
Contributor

mjs commented Oct 10, 2016

This test was passing more by luck than anything.

Fixes https://bugs.launchpad.net/juju/+bug/1632105

QA

Many iterations with the stress test script. Before the fix the stress tester would trigger the problem within a handful of iterations.

api: Fix clock waits in TestLaterPingFails
This test was passing more by luck than anything.

Fixes https://bugs.launchpad.net/juju/+bug/1632105
Contributor

mjs commented Oct 10, 2016

$$merge$$

Contributor

jujubot commented Oct 10, 2016

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

Contributor

jujubot commented Oct 10, 2016

Build failed: Tests failed
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/9468

Contributor

mjs commented Oct 10, 2016

$$merge$$

Contributor

jujubot commented Oct 10, 2016

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

@jujubot jujubot merged commit af4424b into juju:master Oct 10, 2016

@mjs mjs deleted the mjs:1632105-TestLaterPingFails-fix branch Oct 10, 2016

assertEvent(c, s.clock.Alarms())
+}
+
+func (s *MonitorSuite) waitThenAdvance(c *gc.C, d time.Duration) {
@reedobrien

reedobrien Oct 11, 2016

Contributor

FWIW I think this is the exact situation we added clock.WaitAdvance https://github.com/juju/testing/blob/master/clock.go#L112 for. With the added benefit that you can specify the number of timers to wait for, and it only waits if clock.waiting doesn't have than number of timers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment