api: fix TestFallbackToIPLookupWhenCacheOutOfDate flakiness #7434

Merged
merged 1 commit into from Jun 1, 2017

Conversation

Projects
None yet
3 participants
Owner

rogpeppe commented Jun 1, 2017

In TestFallbackToIPLookupWhenCacheOutOfDate, we were expecting both
dial attempts to have been called before the api.Open call returned.
However, each dial attempt is called in its own goroutine, so the second
address can start and complete before the first one starts, at which
point the attempt is cancelled and the first address retry loop will
never be entered.

We fix this by waiting synchronously for the dial
attempts and only letting them complete
when we see that they've happened.

api: fix TestFallbackToIPLookupWhenCacheOutOfDate flakiness
In TestFallbackToIPLookupWhenCacheOutOfDate, we were expecting both
dial attempts to have been called before the api.Open call returned.
However, each dial attempt is called in its own goroutine, so the second
address can start and complete before the first one starts, at which
point the attempt is cancelled and the first address retry loop will
never be entered.

We fix this by waiting synchronously for the dial
attempts and only letting them complete
when we see that they've happened.
Owner

rogpeppe commented Jun 1, 2017

$$merge$$

Contributor

jujubot commented Jun 1, 2017

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

Owner

rogpeppe commented Jun 1, 2017

$$merge$$

@jujubot jujubot merged commit b6220ba into juju:develop Jun 1, 2017

1 check failed

github-check-merge-juju Built PR, ran unit tests, and tested LXD deploy. Use !!.*!! to request another build. IE, !!build!!, !!retry!!
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment