Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(5457)

Issue 6574061: uniter: faster tests

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 7 months ago by fwereade
Modified:
11 years, 7 months ago
Reviewers:
mp+127026
Visibility:
Public.

Description

uniter: faster tests In each case, without regular StartSyncing, the Uniter just hangs around waiting for events that... well, they come sooner or later, and the timeouts are long so the tests are reliable. But I think that, in the interests of sanity, it's better to make the environment unrealistically eager. https://code.launchpad.net/~fwereade/juju-core/faster-uniter-tests/+merge/127026 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 4

Patch Set 2 : uniter: faster tests #

Unified diffs Side-by-side diffs Delta from patch set Stats (+6 lines, -2 lines) Patch
A [revision details] View 1 1 chunk +2 lines, -0 lines 0 comments Download
M worker/uniter/uniter_test.go View 1 4 chunks +4 lines, -2 lines 0 comments Download

Messages

Total messages: 4
fwereade
Please take a look.
11 years, 7 months ago (2012-09-28 16:43:35 UTC) #1
niemeyer
Couple of questions: https://codereview.appspot.com/6574061/diff/1/worker/uniter/uniter_test.go File worker/uniter/uniter_test.go (right): https://codereview.appspot.com/6574061/diff/1/worker/uniter/uniter_test.go#newcode853 worker/uniter/uniter_test.go:853: ctx.st.StartSync() What is done before the ...
11 years, 7 months ago (2012-09-28 17:19:50 UTC) #2
niemeyer
LGTM, thanks for the explanations.
11 years, 7 months ago (2012-09-28 17:26:30 UTC) #3
fwereade
11 years, 7 months ago (2012-09-28 22:36:58 UTC) #4
*** Submitted:

uniter: faster tests

In each case, without regular StartSyncing, the Uniter just hangs around
waiting for events that... well, they come sooner or later, and the timeouts
are long so the tests are reliable. But I think that, in the interests of
sanity, it's better to make the environment unrealistically eager.

R=niemeyer
CC=
https://codereview.appspot.com/6574061

https://codereview.appspot.com/6574061/diff/1/worker/uniter/uniter_test.go
File worker/uniter/uniter_test.go (right):

https://codereview.appspot.com/6574061/diff/1/worker/uniter/uniter_test.go#ne...
worker/uniter/uniter_test.go:853: ctx.st.StartSync()
On 2012/09/28 17:19:50, niemeyer wrote:
> What is done before the next sync below for this to be useful?

As discussed live: this is to goose the watcher into sending changes to the
uniter sooner rather than later -- in this case specifically, it is in the hope
of inducing an unexpected hook to run before the sleep below completes. (Huh, it
should totally be inside the if block).

https://codereview.appspot.com/6574061/diff/1/worker/uniter/uniter_test.go#ne...
worker/uniter/uniter_test.go:856: time.Sleep(200 * time.Millisecond)
On 2012/09/28 17:19:50, niemeyer wrote:
> This is a bit strange, btw. What are "unwanted" hooks, and why do we have to
> sleep to wait?

Specifically, a zero waitHooks verifies that the real hook history matches the
expected hook history precisely. Unwanted hooks are just hook in real history
that expected history tells us should not exist -- ie test failures.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b