pkg/transport: extend wait timeout for write

This helps the test to pass safely in semaphore CI.

Based on my manual testing, it may take at most 500ms to return
error in semaphore CI, so I set 1s as a safe value.
This commit is contained in:
Yicheng Qin 2015-10-21 18:19:33 -07:00
parent 56b7584418
commit d3ebecdddd
2 changed files with 4 additions and 2 deletions

View File

@ -50,7 +50,8 @@ func TestReadWriteTimeoutDialer(t *testing.T) {
select {
case <-done:
case <-time.After(d.wtimeoutd * 10):
// It waits 1s more to avoid delay in low-end system.
case <-time.After(d.wtimeoutd*10 + time.Second):
t.Fatal("wait timeout")
}

View File

@ -76,7 +76,8 @@ func TestWriteReadTimeoutListener(t *testing.T) {
select {
case <-done:
case <-time.After(wln.wtimeoutd * 10):
// It waits 1s more to avoid delay in low-end system.
case <-time.After(wln.wtimeoutd*10 + time.Second):
t.Fatal("wait timeout")
}