Skip to content

Commit

Permalink
fix failing test
Browse files Browse the repository at this point in the history
In a unit test we hardcode 127.0.0.1 localhost ipv4 address.

However, sometimes we are returned the ipv6 localhost address.

Include this option in the regex
  • Loading branch information
jack-w-shaw committed Jul 12, 2024
1 parent ac607e9 commit c31a632
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion httpbakery/keyring_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func TestThirdPartyInfoForLocationWrongURL(t *testing.T) {
_, err := httpbakery.ThirdPartyInfoForLocation(testContext, client, "http://localhost:0")
c.Logf("%v", errgo.Details(err))
c.Assert(err, qt.ErrorMatches,
`(Get|GET) ["]?http://localhost:0/discharge/info["]?: dial tcp 127.0.0.1:0: .*connection refused`)
`(Get|GET) ["]?http://localhost:0/discharge/info["]?: dial tcp (127.0.0.1|\[::1\]):0: .*connection refused`)
}

func TestThirdPartyInfoForLocationReturnsInvalidJSON(t *testing.T) {
Expand Down

0 comments on commit c31a632

Please sign in to comment.