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

Issue 11525045: state,worker/provisioner: fix test timeouts

Can't Edit
Can't Publish+Mail
Start Review
Created:
6 years, 3 months ago by rog
Modified:
6 years, 3 months ago
Reviewers:
dimitern, mp+176155, gz
Visibility:
Public.

Description

state,worker/provisioner: fix test timeouts A couple of places that were relying on testing.ShortWait to wait for something to happen. There are a few more, but this should help matters for the time being. https://code.launchpad.net/~rogpeppe/juju-core/343-fix-test-timeouts/+merge/176155 (do not edit description out of merge proposal)

Patch Set 1 #

Patch Set 2 : state,worker/provisioner: fix test timeouts #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+36 lines, -17 lines) Patch
A [revision details] View 1 chunk +2 lines, -0 lines 0 comments Download
M state/testing/watcher.go View 1 chunk +20 lines, -11 lines 2 comments Download
M utils/fslock/fslock_test.go View 1 chunk +1 line, -1 line 0 comments Download
M worker/provisioner/provisioner_test.go View 1 chunk +13 lines, -5 lines 2 comments Download

Messages

Total messages: 4
rog
Please take a look.
6 years, 3 months ago (2013-07-22 10:45:03 UTC) #1
dimitern
LGTM, thank you!
6 years, 3 months ago (2013-07-22 10:46:08 UTC) #2
gz
LGTM https://codereview.appspot.com/11525045/diff/3001/state/testing/watcher.go File state/testing/watcher.go (right): https://codereview.appspot.com/11525045/diff/3001/state/testing/watcher.go#newcode170 state/testing/watcher.go:170: for { Okay, to check I understand this, ...
6 years, 3 months ago (2013-07-22 10:53:39 UTC) #3
rog
6 years, 3 months ago (2013-07-22 11:00:48 UTC) #4
https://codereview.appspot.com/11525045/diff/3001/state/testing/watcher.go
File state/testing/watcher.go (right):

https://codereview.appspot.com/11525045/diff/3001/state/testing/watcher.go#ne...
state/testing/watcher.go:170: for {
On 2013/07/22 10:53:39, gz wrote:
> Okay, to check I understand this, previously the code would stop at:
> 1) timeout
> 2) when some changes arrived
> 
> If a list of more than one change was expected, it could recieve one, but not
> the remainder, and the test would fail.
> 
> So, now it waits for:
> 1) timeout
> 2) as many or more changes as were expected

that's right.

i'm not actually *quite* sure why the duration of ShortWait influenced the
number of changes delivered ( should probably investigate further to understand
that better), but this change seems right regardless - changes can always be
delivered piecemeal.

https://codereview.appspot.com/11525045/diff/3001/worker/provisioner/provisio...
File worker/provisioner/provisioner_test.go (right):

https://codereview.appspot.com/11525045/diff/3001/worker/provisioner/provisio...
worker/provisioner/provisioner_test.go:343: for time.Since(t0) <
coretesting.LongWait {
On 2013/07/22 10:53:39, gz wrote:
> Feels like this should be factorable into a common helper.

there is already a common helper (AttemptStrategy). it's
not so convenient to use here though - i intend to reimport
gustavo's modifications to it from ec2 at some point,
and we can revisit.
Sign in to reply to this message.

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