aboutsummaryrefslogtreecommitdiff
path: root/fasthttputil
diff options
context:
space:
mode:
authorGravatar Erik Dubbelboer <erik@dubbelboer.com> 2021-06-18 14:57:18 +0200
committerGravatar Erik Dubbelboer <erik@dubbelboer.com> 2021-06-18 14:57:18 +0200
commit9f2c63676d93a1fe1cf836f1ae125fa5fb566039 (patch)
treed7ae04044a81c18c7f250d4e93114f3008b452f4 /fasthttputil
parentfix: set content-length properly when StreanRequestBody was enabled (#1049) (diff)
downloadfasthttp-9f2c63676d93a1fe1cf836f1ae125fa5fb566039.tar.gz
fasthttp-9f2c63676d93a1fe1cf836f1ae125fa5fb566039.tar.bz2
fasthttp-9f2c63676d93a1fe1cf836f1ae125fa5fb566039.zip
Lower go test time
Diffstat (limited to 'fasthttputil')
-rw-r--r--fasthttputil/inmemory_listener_test.go8
-rw-r--r--fasthttputil/pipeconns_test.go18
2 files changed, 26 insertions, 0 deletions
diff --git a/fasthttputil/inmemory_listener_test.go b/fasthttputil/inmemory_listener_test.go
index 9de59e1..cdd7763 100644
--- a/fasthttputil/inmemory_listener_test.go
+++ b/fasthttputil/inmemory_listener_test.go
@@ -14,6 +14,8 @@ import (
)
func TestInmemoryListener(t *testing.T) {
+ t.Parallel()
+
ln := NewInmemoryListener()
ch := make(chan struct{})
@@ -156,12 +158,16 @@ func testInmemoryListenerHTTPSingle(t *testing.T, client *http.Client, content s
}
func TestInmemoryListenerHTTPSingle(t *testing.T) {
+ t.Parallel()
+
testInmemoryListenerHTTP(t, func(t *testing.T, client *http.Client) {
testInmemoryListenerHTTPSingle(t, client, "request")
})
}
func TestInmemoryListenerHTTPSerial(t *testing.T) {
+ t.Parallel()
+
testInmemoryListenerHTTP(t, func(t *testing.T, client *http.Client) {
for i := 0; i < 10; i++ {
testInmemoryListenerHTTPSingle(t, client, fmt.Sprintf("request_%d", i))
@@ -170,6 +176,8 @@ func TestInmemoryListenerHTTPSerial(t *testing.T) {
}
func TestInmemoryListenerHTTPConcurrent(t *testing.T) {
+ t.Parallel()
+
testInmemoryListenerHTTP(t, func(t *testing.T, client *http.Client) {
var wg sync.WaitGroup
for i := 0; i < 10; i++ {
diff --git a/fasthttputil/pipeconns_test.go b/fasthttputil/pipeconns_test.go
index 97c294f..d61e5e5 100644
--- a/fasthttputil/pipeconns_test.go
+++ b/fasthttputil/pipeconns_test.go
@@ -11,6 +11,8 @@ import (
)
func TestPipeConnsWriteTimeout(t *testing.T) {
+ t.Parallel()
+
pc := NewPipeConns()
c1 := pc.Conn1()
@@ -67,10 +69,14 @@ func TestPipeConnsWriteTimeout(t *testing.T) {
}
func TestPipeConnsPositiveReadTimeout(t *testing.T) {
+ t.Parallel()
+
testPipeConnsReadTimeout(t, time.Millisecond)
}
func TestPipeConnsNegativeReadTimeout(t *testing.T) {
+ t.Parallel()
+
testPipeConnsReadTimeout(t, -time.Second)
}
@@ -116,6 +122,8 @@ func testPipeConnsReadTimeout(t *testing.T, timeout time.Duration) {
}
func TestPipeConnsCloseWhileReadWriteConcurrent(t *testing.T) {
+ t.Parallel()
+
concurrency := 4
ch := make(chan struct{}, concurrency)
for i := 0; i < concurrency; i++ {
@@ -135,6 +143,8 @@ func TestPipeConnsCloseWhileReadWriteConcurrent(t *testing.T) {
}
func TestPipeConnsCloseWhileReadWriteSerial(t *testing.T) {
+ t.Parallel()
+
testPipeConnsCloseWhileReadWriteSerial(t)
}
@@ -205,10 +215,14 @@ func testPipeConnsCloseWhileReadWrite(t *testing.T) {
}
func TestPipeConnsReadWriteSerial(t *testing.T) {
+ t.Parallel()
+
testPipeConnsReadWriteSerial(t)
}
func TestPipeConnsReadWriteConcurrent(t *testing.T) {
+ t.Parallel()
+
testConcurrency(t, 10, testPipeConnsReadWriteSerial)
}
@@ -262,10 +276,14 @@ func testPipeConnsReadWrite(t *testing.T, c1, c2 net.Conn) {
}
func TestPipeConnsCloseSerial(t *testing.T) {
+ t.Parallel()
+
testPipeConnsCloseSerial(t)
}
func TestPipeConnsCloseConcurrent(t *testing.T) {
+ t.Parallel()
+
testConcurrency(t, 10, testPipeConnsCloseSerial)
}