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

Issue 6696043: environs/jujutest: use AttemptStrategy

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

Description

environs/jujutest: use AttemptStrategy Since AttemptStrategy is now defined externally, it makes it easy to use between packages (not the case when this code was written). We also use the strategy in TestFile, which should remove the most failure that I have most observed when running live tests. We also use it in environs/ec2 itself where appropriate. https://code.launchpad.net/~rogpeppe/juju-core/132-fix-TestFile/+merge/129690 (do not edit description out of merge proposal)

Patch Set 1 #

Patch Set 2 : environs/jujutest: use AttemptStrategy #

Patch Set 3 : environs/jujutest: use AttemptStrategy #

Patch Set 4 : environs/jujutest: use AttemptStrategy #

Patch Set 5 : environs/jujutest: use AttemptStrategy #

Total comments: 4

Patch Set 6 : environs/jujutest: use AttemptStrategy #

Patch Set 7 : environs/jujutest: use AttemptStrategy #

Total comments: 13

Patch Set 8 : environs/jujutest: use AttemptStrategy #

Patch Set 9 : environs/jujutest: use AttemptStrategy #

Patch Set 10 : environs/jujutest: use AttemptStrategy #

Unified diffs Side-by-side diffs Delta from patch set Stats (+62 lines, -55 lines) Patch
A [revision details] View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -0 lines 0 comments Download
M environs/ec2/ec2.go View 1 2 3 4 5 6 7 8 9 1 chunk +10 lines, -1 line 0 comments Download
M environs/ec2/export_test.go View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M environs/ec2/live_test.go View 1 2 3 4 5 6 7 8 4 chunks +8 lines, -11 lines 0 comments Download
M environs/jujutest/livetests.go View 1 2 3 4 5 6 7 8 9 4 chunks +23 lines, -21 lines 0 comments Download
M environs/jujutest/tests.go View 1 2 3 4 5 6 7 8 9 8 chunks +17 lines, -22 lines 0 comments Download

Messages

Total messages: 12
rog
Please take a look.
11 years, 6 months ago (2012-10-15 15:26:16 UTC) #1
rog
Please take a look.
11 years, 6 months ago (2012-10-15 15:53:59 UTC) #2
rog
Please take a look.
11 years, 6 months ago (2012-10-15 16:20:23 UTC) #3
niemeyer
https://codereview.appspot.com/6696043/diff/5006/environs/jujutest/livetests.go File environs/jujutest/livetests.go (right): https://codereview.appspot.com/6696043/diff/5006/environs/jujutest/livetests.go#newcode275 environs/jujutest/livetests.go:275: if err = t.Env.Bootstrap(false); err != nil { These ...
11 years, 6 months ago (2012-10-16 18:07:36 UTC) #4
rog
https://codereview.appspot.com/6696043/diff/5006/environs/jujutest/livetests.go File environs/jujutest/livetests.go (right): https://codereview.appspot.com/6696043/diff/5006/environs/jujutest/livetests.go#newcode275 environs/jujutest/livetests.go:275: if err = t.Env.Bootstrap(false); err != nil { On ...
11 years, 6 months ago (2012-10-17 08:33:58 UTC) #5
niemeyer
https://codereview.appspot.com/6696043/diff/5006/environs/jujutest/livetests.go File environs/jujutest/livetests.go (right): https://codereview.appspot.com/6696043/diff/5006/environs/jujutest/livetests.go#newcode275 environs/jujutest/livetests.go:275: if err = t.Env.Bootstrap(false); err != nil { On ...
11 years, 6 months ago (2012-10-17 11:59:11 UTC) #6
rog
Please take a look. https://codereview.appspot.com/6696043/diff/5006/environs/jujutest/livetests.go File environs/jujutest/livetests.go (right): https://codereview.appspot.com/6696043/diff/5006/environs/jujutest/livetests.go#newcode275 environs/jujutest/livetests.go:275: if err = t.Env.Bootstrap(false); err ...
11 years, 6 months ago (2012-10-17 14:01:22 UTC) #7
niemeyer
https://codereview.appspot.com/6696043/diff/19001/environs/ec2/ec2.go File environs/ec2/ec2.go (right): https://codereview.appspot.com/6696043/diff/19001/environs/ec2/ec2.go#newcode214 environs/ec2/ec2.go:214: // up yet, so we retry in case that's ...
11 years, 6 months ago (2012-10-17 22:27:19 UTC) #8
niemeyer
LGTM considering these.
11 years, 6 months ago (2012-10-17 22:27:33 UTC) #9
rog
Please take a look. https://codereview.appspot.com/6696043/diff/19001/environs/ec2/ec2.go File environs/ec2/ec2.go (right): https://codereview.appspot.com/6696043/diff/19001/environs/ec2/ec2.go#newcode214 environs/ec2/ec2.go:214: // up yet, so we ...
11 years, 6 months ago (2012-10-18 10:34:43 UTC) #10
niemeyer
Still LGTM https://codereview.appspot.com/6696043/diff/19001/environs/ec2/export_test.go File environs/ec2/export_test.go (right): https://codereview.appspot.com/6696043/diff/19001/environs/ec2/export_test.go#newcode99 environs/ec2/export_test.go:99: var ShortAttempt = &shortAttempt On 2012/10/18 10:34:44, ...
11 years, 6 months ago (2012-10-18 19:15:14 UTC) #11
rog
11 years, 6 months ago (2012-10-19 12:40:30 UTC) #12
*** Submitted:

environs/jujutest: use AttemptStrategy

Since AttemptStrategy is now defined externally,
it makes it easy to use between packages
(not the case when this code was written).

We also use the strategy in TestFile, which
should remove the most failure that I have
most observed when running live tests.

We also use it in environs/ec2 itself where appropriate.

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

https://codereview.appspot.com/6696043/diff/19001/environs/ec2/export_test.go
File environs/ec2/export_test.go (right):

https://codereview.appspot.com/6696043/diff/19001/environs/ec2/export_test.go...
environs/ec2/export_test.go:99: var ShortAttempt = &shortAttempt
On 2012/10/18 19:15:14, niemeyer wrote:
> On 2012/10/18 10:34:44, rog wrote:
> > It actually gives more value than one might think, because the live tests
are
> > also used in the non-live context, and for the non-live tests, shortAttempt
> has
> > a much shorter time out (see ShortTimeouts above). So by using this value
> > directly, we speed up the tests. I hope it's OK to leave it as is.
> 
> This benefit doesn't come from using internal details.
> 
> > An alternative would be to define shortAttempt and ShortTimeouts in the test
> > code too, so we've got two instances of it. If you think that's better, I'll
> do
> > that, but given that the testing code already has knowledge of shortAttempt,
I
> > can't see that it would be worth it.
> 
> It doesn't use it. The line above is new.

but the ShortTimeouts code is not new - that's the testing code I was referring
to that uses shortAttempt.

i'll submit as is and we can discuss what the right approach is later (i'm not
sure what your reaction was to my suggestion to duplicate shortAttempt and
ShortTimeouts).
Sign in to reply to this message.

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