Commit 3eabdd29 authored by Ian Lance Taylor's avatar Ian Lance Taylor

net: skip TestDialCancel if Dial fails with "connection refused"

Fixes #15191

Change-Id: I86214ede619400acd44f21138b5ddf6cef4649a3
Reviewed-on: https://go-review.googlesource.com/c/go/+/205698
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 198f0452
...@@ -14,6 +14,7 @@ import ( ...@@ -14,6 +14,7 @@ import (
"io" "io"
"os" "os"
"runtime" "runtime"
"strings"
"sync" "sync"
"testing" "testing"
"time" "time"
...@@ -759,10 +760,6 @@ func TestDialerKeepAlive(t *testing.T) { ...@@ -759,10 +760,6 @@ func TestDialerKeepAlive(t *testing.T) {
} }
func TestDialCancel(t *testing.T) { func TestDialCancel(t *testing.T) {
switch testenv.Builder() {
case "linux-arm64-buildlet":
t.Skip("skipping on linux-arm64-buildlet; incompatible network config? issue 15191")
}
mustHaveExternalNetwork(t) mustHaveExternalNetwork(t)
blackholeIPPort := JoinHostPort(slowDst4, "1234") blackholeIPPort := JoinHostPort(slowDst4, "1234")
...@@ -807,6 +804,11 @@ func TestDialCancel(t *testing.T) { ...@@ -807,6 +804,11 @@ func TestDialCancel(t *testing.T) {
t.Error(perr) t.Error(perr)
} }
if ticks < cancelTick { if ticks < cancelTick {
// Using strings.Contains is ugly but
// may work on plan9 and windows.
if strings.Contains(err.Error(), "connection refused") {
t.Skipf("connection to %v failed fast with %v", blackholeIPPort, err)
}
t.Fatalf("dial error after %d ticks (%d before cancel sent): %v", t.Fatalf("dial error after %d ticks (%d before cancel sent): %v",
ticks, cancelTick-ticks, err) ticks, cancelTick-ticks, err)
} }
......
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