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

Issue 6815089: uniter_test: snappier waitUniterDead

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

Description

uniter_test: snappier waitUniterDead waitUniterDead was on occasion waiting almost the full 5 seconds before the uniter happened to notice it was ready to die. We now repeatedly sync state while waiting, in order to ensure timely detection of state changes on the uniter side. On this machine, this change speeds up the uniter suite by roughly 20%. https://code.launchpad.net/~fwereade/juju-core/trivial-speed-uniter-tests/+merge/133041 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 4

Patch Set 2 : uniter_test: snappier waitUniterDead #

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

Messages

Total messages: 8
fwereade
Please take a look.
11 years, 6 months ago (2012-11-06 11:34:51 UTC) #1
jameinel
The StartSync comment seems to indicate that it is already called in the background, however ...
11 years, 6 months ago (2012-11-06 12:20:43 UTC) #2
aram
> The StartSync comment seems to indicate that it is already called > in the ...
11 years, 6 months ago (2012-11-06 13:58:34 UTC) #3
aram
https://codereview.appspot.com/6815089/diff/1/worker/uniter/uniter_test.go File worker/uniter/uniter_test.go (right): https://codereview.appspot.com/6815089/diff/1/worker/uniter/uniter_test.go#newcode848 worker/uniter/uniter_test.go:848: timeout := time.After(5 * time.Second) Why not just put ...
11 years, 6 months ago (2012-11-06 13:58:37 UTC) #4
rog
LGTM but i'd like to know the same thing as Aram. it could at least ...
11 years, 6 months ago (2012-11-09 10:21:35 UTC) #5
fwereade
https://codereview.appspot.com/6815089/diff/1/worker/uniter/uniter_test.go File worker/uniter/uniter_test.go (right): https://codereview.appspot.com/6815089/diff/1/worker/uniter/uniter_test.go#newcode848 worker/uniter/uniter_test.go:848: timeout := time.After(5 * time.Second) On 2012/11/06 13:58:37, aram ...
11 years, 5 months ago (2012-11-12 13:22:30 UTC) #6
aram
https://codereview.appspot.com/6815089/diff/1/worker/uniter/uniter_test.go File worker/uniter/uniter_test.go (right): https://codereview.appspot.com/6815089/diff/1/worker/uniter/uniter_test.go#newcode848 worker/uniter/uniter_test.go:848: timeout := time.After(5 * time.Second) I'm slightly concerned about ...
11 years, 5 months ago (2012-11-12 14:12:45 UTC) #7
fwereade
11 years, 5 months ago (2012-11-13 16:37:45 UTC) #8
*** Submitted:

uniter_test: snappier waitUniterDead

waitUniterDead was on occasion waiting almost the full 5 seconds before the
uniter happened to notice it was ready to die. We now repeatedly sync state
while waiting, in order to ensure timely detection of state changes on the
uniter side. On this machine, this change speeds up the uniter suite by
roughly 20%.

R=
CC=
https://codereview.appspot.com/6815089

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

https://codereview.appspot.com/6815089/diff/1/worker/uniter/uniter_test.go#ne...
worker/uniter/uniter_test.go:848: timeout := time.After(5 * time.Second)
On 2012/11/12 14:12:45, aram wrote:
> I'm slightly concerned about this. It looks like we have a race and we
> decided to solve it by altering timings and (almost) busy waiting.
> 
> Isn't there a clean way to solve this problem? (I'm just asking because I
> am not familiar with the code). If there isn't any cleaner way to solve
> this problem, or if the technical cost of solving it in a better way is
> too high, LGTM (but please add a comment).

Well, it *is* rare for us to need additional syncs, but it's not unheard of and
the bit that demands it was discussed and OKed a while ago. Commented and
submitted.
Sign in to reply to this message.

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