mirror of https://github.com/cbeuw/Cloak
Give time dependent tests more leeway
This commit is contained in:
parent
13c1c3705b
commit
2682460d46
|
|
@ -60,7 +60,7 @@ func TestReadBlock(t *testing.T) {
|
||||||
pipe := NewBufferedPipe()
|
pipe := NewBufferedPipe()
|
||||||
b := []byte{0x01, 0x02, 0x03}
|
b := []byte{0x01, 0x02, 0x03}
|
||||||
go func() {
|
go func() {
|
||||||
time.Sleep(10 * time.Millisecond)
|
time.Sleep(100 * time.Millisecond)
|
||||||
pipe.Write(b)
|
pipe.Write(b)
|
||||||
}()
|
}()
|
||||||
b2 := make([]byte, len(b))
|
b2 := make([]byte, len(b))
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@ func TestDatagramBuffer_BlockingRead(t *testing.T) {
|
||||||
pipe := NewDatagramBuffer()
|
pipe := NewDatagramBuffer()
|
||||||
b := []byte{0x01, 0x02, 0x03}
|
b := []byte{0x01, 0x02, 0x03}
|
||||||
go func() {
|
go func() {
|
||||||
time.Sleep(10 * time.Millisecond)
|
time.Sleep(100 * time.Millisecond)
|
||||||
pipe.Write(Frame{Payload: b})
|
pipe.Write(Frame{Payload: b})
|
||||||
}()
|
}()
|
||||||
b2 := make([]byte, len(b))
|
b2 := make([]byte, len(b))
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,6 @@ package multiplex
|
||||||
import (
|
import (
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
"io"
|
"io"
|
||||||
"time"
|
|
||||||
|
|
||||||
//"log"
|
//"log"
|
||||||
"sort"
|
"sort"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
@ -29,8 +27,6 @@ func TestRecvNewFrame(t *testing.T) {
|
||||||
sb.Write(frame)
|
sb.Write(frame)
|
||||||
}
|
}
|
||||||
|
|
||||||
time.Sleep(100 * time.Millisecond)
|
|
||||||
|
|
||||||
var sortedResult []uint64
|
var sortedResult []uint64
|
||||||
for x := 0; x < len(set); x++ {
|
for x := 0; x < len(set); x++ {
|
||||||
oct := make([]byte, 8)
|
oct := make([]byte, 8)
|
||||||
|
|
|
||||||
|
|
@ -178,7 +178,7 @@ func TestSwitchboard_ConnsCount(t *testing.T) {
|
||||||
|
|
||||||
sesh.sb.closeAll()
|
sesh.sb.closeAll()
|
||||||
|
|
||||||
time.Sleep(100 * time.Millisecond)
|
time.Sleep(500 * time.Millisecond)
|
||||||
if sesh.sb.connsCount() != 0 {
|
if sesh.sb.connsCount() != 0 {
|
||||||
t.Error("connsCount incorrect")
|
t.Error("connsCount incorrect")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -316,7 +316,7 @@ func TestClosingStreamsFromProxy(t *testing.T) {
|
||||||
serverConn, _ := pxyServerL.Accept()
|
serverConn, _ := pxyServerL.Accept()
|
||||||
serverConn.Close()
|
serverConn.Close()
|
||||||
|
|
||||||
time.Sleep(300 * time.Millisecond)
|
time.Sleep(500 * time.Millisecond)
|
||||||
if _, err := clientConn.Read(make([]byte, 16)); err == nil {
|
if _, err := clientConn.Read(make([]byte, 16)); err == nil {
|
||||||
t.Errorf("closing stream on server side is not reflected to the client: %v", err)
|
t.Errorf("closing stream on server side is not reflected to the client: %v", err)
|
||||||
}
|
}
|
||||||
|
|
@ -329,7 +329,7 @@ func TestClosingStreamsFromProxy(t *testing.T) {
|
||||||
serverConn, _ := pxyServerL.Accept()
|
serverConn, _ := pxyServerL.Accept()
|
||||||
clientConn.Close()
|
clientConn.Close()
|
||||||
|
|
||||||
time.Sleep(300 * time.Millisecond)
|
time.Sleep(500 * time.Millisecond)
|
||||||
if _, err := serverConn.Read(make([]byte, 16)); err == nil {
|
if _, err := serverConn.Read(make([]byte, 16)); err == nil {
|
||||||
t.Errorf("closing stream on client side is not reflected to the server: %v", err)
|
t.Errorf("closing stream on client side is not reflected to the server: %v", err)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue