utils/ssh: test fails if host lookup succeeds
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
juju-core |
Fix Released
|
High
|
Roger Peppe |
Bug Description
TestClientNoKeys uses "test.invalid" for a host name. The test fails (after a long time)
because "test.invalid" resolves to an IP address for me, so I see:
FAIL: ssh_gocrypto_
[LOG] 36.85478 DEBUG juju.utils.ssh command.Wait finished: signal: killed
ssh_gocrypto_
// error message differs based on whether using cgo or not
c.Assert(err, gc.ErrorMatches, "(dial tcp: )?lookup test.invalid: no such host")
... error string = "dial tcp 92.242.132.16:22: connection timed out"
... regex string = "(dial tcp: )?lookup test.invalid: no such host"
No test should rely on external DNS to provide a reliable resolution.
"0.1.2.3" is more reliable, as it's invalid at a much lower level.
Related branches
- Juju Engineering: Pending requested
-
Diff: 43 lines (+5/-4)2 files modifiedprovider/local/environprovider_test.go (+1/-0)
utils/ssh/ssh_gocrypto_test.go (+4/-4)
tags: | added: intermittent-failure |
Changed in juju-core: | |
status: | New → Triaged |
importance: | Undecided → High |
Changed in juju-core: | |
status: | Triaged → Fix Committed |
Changed in juju-core: | |
milestone: | none → 1.17.2 |
assignee: | nobody → Roger Peppe (rogpeppe) |
Changed in juju-core: | |
status: | Fix Committed → Fix Released |