Skip to content

Commit 750115f

Browse files
authored
p2p/nat: skip TestUPNP in non-CI environments if discover fails (ethereum#22877)
Fixes ethereum#21476
1 parent 51b32cc commit 750115f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

p2p/nat/natupnp_test.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"io"
2222
"net"
2323
"net/http"
24+
"os"
2425
"runtime"
2526
"strings"
2627
"testing"
@@ -162,7 +163,11 @@ func TestUPNP_DDWRT(t *testing.T) {
162163
// Attempt to discover the fake device.
163164
discovered := discoverUPnP()
164165
if discovered == nil {
165-
t.Fatalf("not discovered")
166+
if os.Getenv("CI") != "" {
167+
t.Fatalf("not discovered")
168+
} else {
169+
t.Skipf("UPnP not discovered (known issue, see https://github.com/ethereum/go-ethereum/issues/21476)")
170+
}
166171
}
167172
upnp, _ := discovered.(*upnp)
168173
if upnp.service != "IGDv1-IP1" {

0 commit comments

Comments
 (0)