Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
go-libp2p
Commits
0789599c
Commit
0789599c
authored
Jan 13, 2015
by
Juan Batiz-Benet
Browse files
p2p/net/swarm: nicer test timeouts for travis
parent
0f910195
Changes
1
Hide whitespace changes
Inline
Side-by-side
net/swarm/dial_test.go
View file @
0789599c
...
@@ -2,6 +2,7 @@ package swarm
...
@@ -2,6 +2,7 @@ package swarm
import
(
import
(
"net"
"net"
"os"
"sync"
"sync"
"testing"
"testing"
"time"
"time"
...
@@ -113,6 +114,9 @@ func TestDialWait(t *testing.T) {
...
@@ -113,6 +114,9 @@ func TestDialWait(t *testing.T) {
defer
s1
.
Close
()
defer
s1
.
Close
()
s1
.
dialT
=
time
.
Millisecond
*
300
// lower timeout for tests.
s1
.
dialT
=
time
.
Millisecond
*
300
// lower timeout for tests.
if
os
.
Getenv
(
"TRAVIS"
)
==
"1"
{
s1
.
dialT
=
time
.
Second
}
// dial to a non-existent peer.
// dial to a non-existent peer.
s2p
,
s2addr
,
s2l
:=
newSilentPeer
(
t
)
s2p
,
s2addr
,
s2l
:=
newSilentPeer
(
t
)
...
@@ -144,6 +148,10 @@ func TestDialWait(t *testing.T) {
...
@@ -144,6 +148,10 @@ func TestDialWait(t *testing.T) {
func
TestDialBackoff
(
t
*
testing
.
T
)
{
func
TestDialBackoff
(
t
*
testing
.
T
)
{
// t.Skip("skipping for another test")
// t.Skip("skipping for another test")
if
os
.
Getenv
(
"TRAVIS"
)
==
"1"
{
t
.
Skip
(
"travis will never have fun with this test"
)
}
t
.
Parallel
()
t
.
Parallel
()
ctx
:=
context
.
Background
()
ctx
:=
context
.
Background
()
...
@@ -367,6 +375,10 @@ func TestDialBackoffClears(t *testing.T) {
...
@@ -367,6 +375,10 @@ func TestDialBackoffClears(t *testing.T) {
defer
s2
.
Close
()
defer
s2
.
Close
()
s1
.
dialT
=
time
.
Millisecond
*
300
// lower timeout for tests.
s1
.
dialT
=
time
.
Millisecond
*
300
// lower timeout for tests.
s2
.
dialT
=
time
.
Millisecond
*
300
// lower timeout for tests.
s2
.
dialT
=
time
.
Millisecond
*
300
// lower timeout for tests.
if
os
.
Getenv
(
"TRAVIS"
)
==
"1"
{
s1
.
dialT
=
time
.
Second
s2
.
dialT
=
time
.
Second
}
// use another address first, that accept and hang on conns
// use another address first, that accept and hang on conns
_
,
s2bad
,
s2l
:=
newSilentPeer
(
t
)
_
,
s2bad
,
s2l
:=
newSilentPeer
(
t
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment