diff options
author | Wolfy-J <[email protected]> | 2018-01-23 20:30:13 -0500 |
---|---|---|
committer | Wolfy-J <[email protected]> | 2018-01-23 20:30:13 -0500 |
commit | 637a6a901563f3a3f0e77200f01dfeb801e177bb (patch) | |
tree | 1b978b89fa8e8e34e55dab01478c6af9aa8de244 /socket_factory_test.go | |
parent | 95f86a2beea5db1c285a2df132e86a3f7c006886 (diff) |
sockets are not fun
Diffstat (limited to 'socket_factory_test.go')
-rw-r--r-- | socket_factory_test.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/socket_factory_test.go b/socket_factory_test.go index 7b8787c2..cfcfab3d 100644 --- a/socket_factory_test.go +++ b/socket_factory_test.go @@ -10,6 +10,8 @@ import ( ) func Test_Tcp_Start(t *testing.T) { + time.Sleep(time.Millisecond * 10) // to ensure free socket + ls, err := net.Listen("tcp", "localhost:9007") if assert.NoError(t, err) { defer ls.Close() @@ -31,6 +33,8 @@ func Test_Tcp_Start(t *testing.T) { } func Test_Tcp_Failboot(t *testing.T) { + time.Sleep(time.Millisecond * 10) // to ensure free socket + ls, err := net.Listen("tcp", "localhost:9007") if assert.NoError(t, err) { defer ls.Close() @@ -47,6 +51,8 @@ func Test_Tcp_Failboot(t *testing.T) { } func Test_Tcp_Timeout(t *testing.T) { + time.Sleep(time.Millisecond * 10) // to ensure free socket + ls, err := net.Listen("tcp", "localhost:9007") if assert.NoError(t, err) { defer ls.Close() @@ -63,6 +69,8 @@ func Test_Tcp_Timeout(t *testing.T) { } func Test_Tcp_Invalid(t *testing.T) { + time.Sleep(time.Millisecond * 10) // to ensure free socket + ls, err := net.Listen("tcp", "localhost:9007") if assert.NoError(t, err) { defer ls.Close() @@ -78,6 +86,8 @@ func Test_Tcp_Invalid(t *testing.T) { } func Test_Tcp_Broken(t *testing.T) { + time.Sleep(time.Millisecond * 10) // to ensure free socket + ls, err := net.Listen("tcp", "localhost:9007") if assert.NoError(t, err) { defer ls.Close() @@ -103,6 +113,8 @@ func Test_Tcp_Broken(t *testing.T) { } func Test_Tcp_Echo(t *testing.T) { + time.Sleep(time.Millisecond * 10) // to ensure free socket + ls, err := net.Listen("tcp", "localhost:9007") if assert.NoError(t, err) { defer ls.Close() |