Unverified Commit 750115ff authored by meowsbits's avatar meowsbits Committed by GitHub

p2p/nat: skip TestUPNP in non-CI environments if discover fails (#22877)

Fixes #21476
parent 51b32cc7
...@@ -21,6 +21,7 @@ import ( ...@@ -21,6 +21,7 @@ import (
"io" "io"
"net" "net"
"net/http" "net/http"
"os"
"runtime" "runtime"
"strings" "strings"
"testing" "testing"
...@@ -162,7 +163,11 @@ func TestUPNP_DDWRT(t *testing.T) { ...@@ -162,7 +163,11 @@ func TestUPNP_DDWRT(t *testing.T) {
// Attempt to discover the fake device. // Attempt to discover the fake device.
discovered := discoverUPnP() discovered := discoverUPnP()
if discovered == nil { if discovered == nil {
if os.Getenv("CI") != "" {
t.Fatalf("not discovered") t.Fatalf("not discovered")
} else {
t.Skipf("UPnP not discovered (known issue, see https://github.com/ethereum/go-ethereum/issues/21476)")
}
} }
upnp, _ := discovered.(*upnp) upnp, _ := discovered.(*upnp)
if upnp.service != "IGDv1-IP1" { if upnp.service != "IGDv1-IP1" {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment