}
func TestDialTimeout(t *testing.T) {
+ // Cannot use t.Parallel - modifies global hooks.
origTestHookDialChannel := testHookDialChannel
defer func() { testHookDialChannel = origTestHookDialChannel }()
defer sw.Set(socktest.FilterConnect, nil)
}
func TestAcceptTimeout(t *testing.T) {
+ t.Parallel()
+
switch runtime.GOOS {
case "plan9":
t.Skipf("not supported on %s", runtime.GOOS)
}
func TestAcceptTimeoutMustReturn(t *testing.T) {
+ t.Parallel()
+
switch runtime.GOOS {
case "plan9":
t.Skipf("not supported on %s", runtime.GOOS)
}
func TestAcceptTimeoutMustNotReturn(t *testing.T) {
+ t.Parallel()
+
switch runtime.GOOS {
case "plan9":
t.Skipf("not supported on %s", runtime.GOOS)
}
func TestReadTimeout(t *testing.T) {
+ t.Parallel()
+
switch runtime.GOOS {
case "plan9":
t.Skipf("not supported on %s", runtime.GOOS)
}
func TestReadTimeoutMustNotReturn(t *testing.T) {
+ t.Parallel()
+
switch runtime.GOOS {
case "plan9":
t.Skipf("not supported on %s", runtime.GOOS)
}
func TestWriteTimeout(t *testing.T) {
+ t.Parallel()
+
switch runtime.GOOS {
case "plan9":
t.Skipf("not supported on %s", runtime.GOOS)
}
func TestWriteTimeoutMustNotReturn(t *testing.T) {
+ t.Parallel()
+
switch runtime.GOOS {
case "plan9":
t.Skipf("not supported on %s", runtime.GOOS)
}
func TestWriteToTimeout(t *testing.T) {
+ t.Parallel()
+
switch runtime.GOOS {
case "nacl", "plan9":
t.Skipf("not supported on %s", runtime.GOOS)
}
func TestReadTimeoutFluctuation(t *testing.T) {
+ t.Parallel()
+
switch runtime.GOOS {
case "plan9":
t.Skipf("not supported on %s", runtime.GOOS)
}
func TestReadFromTimeoutFluctuation(t *testing.T) {
+ t.Parallel()
+
switch runtime.GOOS {
case "plan9":
t.Skipf("not supported on %s", runtime.GOOS)
}
func TestWriteTimeoutFluctuation(t *testing.T) {
+ t.Parallel()
+
switch runtime.GOOS {
case "plan9":
t.Skipf("not supported on %s", runtime.GOOS)
}
}
+func TestVariousDeadlines(t *testing.T) {
+ t.Parallel()
+ testVariousDeadlines(t)
+}
+
func TestVariousDeadlines1Proc(t *testing.T) {
- testVariousDeadlines(t, 1)
+ // Cannot use t.Parallel - modifies global GOMAXPROCS.
+ if testing.Short() {
+ t.Skip("skipping in short mode")
+ }
+ defer runtime.GOMAXPROCS(runtime.GOMAXPROCS(1))
+ testVariousDeadlines(t)
}
func TestVariousDeadlines4Proc(t *testing.T) {
- testVariousDeadlines(t, 4)
+ // Cannot use t.Parallel - modifies global GOMAXPROCS.
+ if testing.Short() {
+ t.Skip("skipping in short mode")
+ }
+ defer runtime.GOMAXPROCS(runtime.GOMAXPROCS(4))
+ testVariousDeadlines(t)
}
type neverEnding byte
return len(p), nil
}
-func testVariousDeadlines(t *testing.T, maxProcs int) {
+func testVariousDeadlines(t *testing.T) {
switch runtime.GOOS {
case "plan9":
t.Skipf("not supported on %s", runtime.GOOS)
}
- defer runtime.GOMAXPROCS(runtime.GOMAXPROCS(maxProcs))
-
type result struct {
n int64
err error
// TestReadWriteProlongedTimeout tests concurrent deadline
// modification. Known to cause data races in the past.
func TestReadWriteProlongedTimeout(t *testing.T) {
+ t.Parallel()
+
switch runtime.GOOS {
case "plan9":
t.Skipf("not supported on %s", runtime.GOOS)
}
func TestReadWriteDeadlineRace(t *testing.T) {
+ t.Parallel()
+
switch runtime.GOOS {
case "nacl", "plan9":
t.Skipf("not supported on %s", runtime.GOOS)