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

Issue 6850121: environs/jujutest: fix test

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

Description

environs/jujutest: fix test LiveTests.TestStartStop did not work when called with an already-bootstrapped environment. Coincidentally, LiveTests.TestDestroy was always called after the only other test to bootstrap, so running all the tests worked. https://code.launchpad.net/~rogpeppe/juju-core/175-ec2-fix-live-tests/+merge/136940 (do not edit description out of merge proposal)

Patch Set 1 #

Patch Set 2 : environs/jujutest: fix test #

Total comments: 2

Patch Set 3 : environs/jujutest: fix test #

Unified diffs Side-by-side diffs Delta from patch set Stats (+16 lines, -7 lines) Patch
A [revision details] View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M environs/jujutest/livetests.go View 1 2 2 chunks +14 lines, -7 lines 0 comments Download

Messages

Total messages: 4
rog
Please take a look.
11 years, 5 months ago (2012-11-29 14:24:27 UTC) #1
TheMue
LGTM
11 years, 5 months ago (2012-11-29 14:29:33 UTC) #2
gz
Tests pass (well, more so than before) for me now. Some nitpicking on specifics but ...
11 years, 5 months ago (2012-11-29 14:56:27 UTC) #3
rog
11 years, 5 months ago (2012-11-29 15:32:35 UTC) #4
*** Submitted:

environs/jujutest: fix test

LiveTests.TestStartStop did not work when called
with an already-bootstrapped environment.
Coincidentally, LiveTests.TestDestroy was
always called after the only other test to bootstrap,
so running all the tests worked.

R=TheMue, gz
CC=
https://codereview.appspot.com/6850121

https://codereview.appspot.com/6850121/diff/2001/environs/jujutest/livetests.go
File environs/jujutest/livetests.go (right):

https://codereview.appspot.com/6850121/diff/2001/environs/jujutest/livetests....
environs/jujutest/livetests.go:119: // new instance.
On 2012/11/29 14:56:27, gz wrote:
> This doesn't actually assert that insts is a set without duplicates. The
> instance appearing in the list multiple times would pass the test. There's no
> set builtin to just do difference and assert on that?

you're right that it doesn't test that the set has no dupes.
i'm not too concerned about that (we don't actually document that that's
necessarily true), so i'm just deleting the comment for the time being.

> Also, asserting len+1 seems slightly fragile still, as this test doesn't
control
> the lifetime of other instances.

the environment is unique for the tests, so this should be fine.
Sign in to reply to this message.

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