api: fix intermittent test failures #6461

Merged
merged 1 commit into from Oct 17, 2016

Conversation

Projects
None yet
4 participants
Owner

rogpeppe commented Oct 17, 2016

The test code assumed that we'd get dial requests in the
order they are specified, but in a heavily loaded test server
this is not necessarily the case, leading to failures like this one:

http://reports.vapour.ws/releases/4490/job/run-unit-tests-xenial-amd64/attempt/1427#highlight​

This fixes the test so that we don't rely on the sequential try ordering - the
concurrent retry mechanism isn't something we need to test in this test,
so just connect to a single address in each test.

LGTM - though one comment against the documentation.

api/apiclient_test.go
+ for i, test := range openWithSNIHostnameTests {
+ c.Logf("test %d: %v", i, test.about)
+ s.testSNIHostName(c, test.info, test.expectDial)
+ }
}
// testSNIHostName tests that when the API is dialed with the given info,
// api.newWebsocketDialer is called with the expected information
// (one element for each call to newWebsocketDialer)
@frobware

frobware Oct 17, 2016

Contributor

Does the 'one element for each...' still hold true?

@rogpeppe

rogpeppe Oct 17, 2016

Owner

Good catch, thanks. Fixed.

LGTM

Owner

rogpeppe commented Oct 17, 2016

$$merge$$

Contributor

jujubot commented Oct 17, 2016

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

@jujubot jujubot merged commit 809dc26 into juju:develop Oct 17, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment