summaryrefslogtreecommitdiff
path: root/src/pkg/net/timeout_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/net/timeout_test.go')
-rw-r--r--src/pkg/net/timeout_test.go25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/pkg/net/timeout_test.go b/src/pkg/net/timeout_test.go
index 35d427a69..9ef0c4d15 100644
--- a/src/pkg/net/timeout_test.go
+++ b/src/pkg/net/timeout_test.go
@@ -120,6 +120,9 @@ func TestReadTimeout(t *testing.T) {
t.Fatalf("Read: expected err %v, got %v", errClosing, err)
}
default:
+ if err == io.EOF && runtime.GOOS == "nacl" { // close enough; golang.org/issue/8044
+ break
+ }
if err != errClosing {
t.Fatalf("Read: expected err %v, got %v", errClosing, err)
}
@@ -348,7 +351,8 @@ func TestReadWriteDeadline(t *testing.T) {
go func() {
c, err := ln.Accept()
if err != nil {
- t.Fatalf("Accept: %v", err)
+ t.Errorf("Accept: %v", err)
+ return
}
defer c.Close()
lnquit <- true
@@ -493,10 +497,7 @@ func testVariousDeadlines(t *testing.T, maxProcs int) {
clientc <- copyRes{n, err, d}
}()
- tooLong := 2 * time.Second
- if runtime.GOOS == "windows" {
- tooLong = 5 * time.Second
- }
+ tooLong := 5 * time.Second
select {
case res := <-clientc:
if isTimeout(res.err) {
@@ -536,7 +537,8 @@ func TestReadDeadlineDataAvailable(t *testing.T) {
go func() {
c, err := ln.Accept()
if err != nil {
- t.Fatalf("Accept: %v", err)
+ t.Errorf("Accept: %v", err)
+ return
}
defer c.Close()
n, err := c.Write([]byte(msg))
@@ -574,7 +576,8 @@ func TestWriteDeadlineBufferAvailable(t *testing.T) {
go func() {
c, err := ln.Accept()
if err != nil {
- t.Fatalf("Accept: %v", err)
+ t.Errorf("Accept: %v", err)
+ return
}
defer c.Close()
c.SetWriteDeadline(time.Now().Add(-5 * time.Second)) // in the past
@@ -610,7 +613,8 @@ func TestAcceptDeadlineConnectionAvailable(t *testing.T) {
go func() {
c, err := Dial("tcp", ln.Addr().String())
if err != nil {
- t.Fatalf("Dial: %v", err)
+ t.Errorf("Dial: %v", err)
+ return
}
defer c.Close()
var buf [1]byte
@@ -669,7 +673,8 @@ func TestProlongTimeout(t *testing.T) {
s, err := ln.Accept()
connected <- true
if err != nil {
- t.Fatalf("ln.Accept: %v", err)
+ t.Errorf("ln.Accept: %v", err)
+ return
}
defer s.Close()
s.SetDeadline(time.Now().Add(time.Hour))
@@ -706,7 +711,7 @@ func TestProlongTimeout(t *testing.T) {
func TestDeadlineRace(t *testing.T) {
switch runtime.GOOS {
- case "plan9":
+ case "nacl", "plan9":
t.Skipf("skipping test on %q", runtime.GOOS)
}