aboutsummaryrefslogtreecommitdiff
path: root/src/net/timeout_test.go
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2017-02-10 14:59:38 -0800
committerIan Lance Taylor <iant@golang.org>2017-02-13 18:36:28 +0000
commit3792db518327c685da17ca6c6faa4e1d2da4c33c (patch)
tree8d2456fa679526c8349a968aaf3cae09524aadfd /src/net/timeout_test.go
parentb548eee3d96fc0b6e962a243b28121e1f37ad792 (diff)
downloadgo-3792db518327c685da17ca6c6faa4e1d2da4c33c.tar.xz
net: refactor poller into new internal/poll package
This will make it possible to use the poller with the os package. This is a lot of code movement but the behavior is intended to be unchanged. Update #6817. Update #7903. Update #15021. Update #18507. Change-Id: I1413685928017c32df5654ded73a2643820977ae Reviewed-on: https://go-review.googlesource.com/36799 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Crawshaw <crawshaw@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src/net/timeout_test.go')
-rw-r--r--src/net/timeout_test.go21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/net/timeout_test.go b/src/net/timeout_test.go
index 55bbf4402d..9de7801ad1 100644
--- a/src/net/timeout_test.go
+++ b/src/net/timeout_test.go
@@ -6,6 +6,7 @@ package net
import (
"fmt"
+ "internal/poll"
"internal/testenv"
"io"
"io/ioutil"
@@ -145,9 +146,9 @@ var acceptTimeoutTests = []struct {
}{
// Tests that accept deadlines in the past work, even if
// there's incoming connections available.
- {-5 * time.Second, [2]error{errTimeout, errTimeout}},
+ {-5 * time.Second, [2]error{poll.ErrTimeout, poll.ErrTimeout}},
- {50 * time.Millisecond, [2]error{nil, errTimeout}},
+ {50 * time.Millisecond, [2]error{nil, poll.ErrTimeout}},
}
func TestAcceptTimeout(t *testing.T) {
@@ -299,9 +300,9 @@ var readTimeoutTests = []struct {
}{
// Tests that read deadlines work, even if there's data ready
// to be read.
- {-5 * time.Second, [2]error{errTimeout, errTimeout}},
+ {-5 * time.Second, [2]error{poll.ErrTimeout, poll.ErrTimeout}},
- {50 * time.Millisecond, [2]error{nil, errTimeout}},
+ {50 * time.Millisecond, [2]error{nil, poll.ErrTimeout}},
}
func TestReadTimeout(t *testing.T) {
@@ -423,9 +424,9 @@ var readFromTimeoutTests = []struct {
}{
// Tests that read deadlines work, even if there's data ready
// to be read.
- {-5 * time.Second, [2]error{errTimeout, errTimeout}},
+ {-5 * time.Second, [2]error{poll.ErrTimeout, poll.ErrTimeout}},
- {50 * time.Millisecond, [2]error{nil, errTimeout}},
+ {50 * time.Millisecond, [2]error{nil, poll.ErrTimeout}},
}
func TestReadFromTimeout(t *testing.T) {
@@ -496,9 +497,9 @@ var writeTimeoutTests = []struct {
}{
// Tests that write deadlines work, even if there's buffer
// space available to write.
- {-5 * time.Second, [2]error{errTimeout, errTimeout}},
+ {-5 * time.Second, [2]error{poll.ErrTimeout, poll.ErrTimeout}},
- {10 * time.Millisecond, [2]error{nil, errTimeout}},
+ {10 * time.Millisecond, [2]error{nil, poll.ErrTimeout}},
}
func TestWriteTimeout(t *testing.T) {
@@ -610,9 +611,9 @@ var writeToTimeoutTests = []struct {
}{
// Tests that write deadlines work, even if there's buffer
// space available to write.
- {-5 * time.Second, [2]error{errTimeout, errTimeout}},
+ {-5 * time.Second, [2]error{poll.ErrTimeout, poll.ErrTimeout}},
- {10 * time.Millisecond, [2]error{nil, errTimeout}},
+ {10 * time.Millisecond, [2]error{nil, poll.ErrTimeout}},
}
func TestWriteToTimeout(t *testing.T) {