utils/ssh: test fails if host lookup succeeds

Bug #1271674 reported by Roger Peppe
6
This bug affects 1 person
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_test.go:101: SSHGoCryptoCommandSuite.TestClientNoKeys

[LOG] 36.85478 DEBUG juju.utils.ssh command.Wait finished: signal: killed
ssh_gocrypto_test.go:113:
    // 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

Curtis Hovey (sinzui)
tags: added: intermittent-failure
Changed in juju-core:
status: New → Triaged
importance: Undecided → High
Roger Peppe (rogpeppe)
Changed in juju-core:
status: Triaged → Fix Committed
Curtis Hovey (sinzui)
Changed in juju-core:
milestone: none → 1.17.2
assignee: nobody → Roger Peppe (rogpeppe)
Curtis Hovey (sinzui)
Changed in juju-core:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.