mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 13:28:01 -05:00
Workaround TestHostIsResolved by using "more reliable" DNS resolver. (#15515)
This commit is contained in:
@@ -370,14 +370,17 @@ func TestStaticPeering_PeersAreAdded(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestHostIsResolved(t *testing.T) {
|
func TestHostIsResolved(t *testing.T) {
|
||||||
// ip.addr.tools - construct domain names that resolve to any given IP address
|
host := "dns.google"
|
||||||
// ex: 192-0-2-1.ip.addr.tools resolves to 192.0.2.1.
|
ips := map[string]bool{
|
||||||
exampleHost := "96-7-129-13.ip.addr.tools"
|
"8.8.8.8": true,
|
||||||
exampleIP := "96.7.129.13"
|
"8.8.4.4": true,
|
||||||
|
"2001:4860:4860::8888": true,
|
||||||
|
"2001:4860:4860::8844": true,
|
||||||
|
}
|
||||||
|
|
||||||
s := &Service{
|
s := &Service{
|
||||||
cfg: &Config{
|
cfg: &Config{
|
||||||
HostDNS: exampleHost,
|
HostDNS: host,
|
||||||
},
|
},
|
||||||
genesisTime: time.Now(),
|
genesisTime: time.Now(),
|
||||||
genesisValidatorsRoot: bytesutil.PadTo([]byte{'A'}, 32),
|
genesisValidatorsRoot: bytesutil.PadTo([]byte{'A'}, 32),
|
||||||
@@ -387,7 +390,7 @@ func TestHostIsResolved(t *testing.T) {
|
|||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
newIP := list.Self().IP()
|
newIP := list.Self().IP()
|
||||||
assert.Equal(t, exampleIP, newIP.String(), "Did not resolve to expected IP")
|
assert.Equal(t, true, ips[newIP.String()], "Did not resolve to expected IP")
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestInboundPeerLimit(t *testing.T) {
|
func TestInboundPeerLimit(t *testing.T) {
|
||||||
|
|||||||
2
changelog/manu-TestHostIsResolved.md
Normal file
2
changelog/manu-TestHostIsResolved.md
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
### Ignored
|
||||||
|
- Workaround `TestHostIsResolved` by using "more reliable" DNS resolver.
|
||||||
Reference in New Issue
Block a user