Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Commit

Permalink
Take steps to avoid the test timing out
Browse files Browse the repository at this point in the history
  • Loading branch information
bboreham committed Nov 2, 2015
1 parent 587de87 commit 6ee8e76
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions nameserver/nameserver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func (m mapping) Addrs() []address.Address {
}

func TestNameservers(t *testing.T) {
wt.RunWithTimeout(t, time.Minute, func() {
wt.RunWithTimeout(t, 2*time.Minute, func() {
testNameservers(t)
})
}
Expand All @@ -81,12 +81,12 @@ func testNameservers(t *testing.T) {
//common.SetLogLevel("debug")

lookupTimeout := 10 // ms
nameservers, grouter := makeNetwork(50)
nameservers, grouter := makeNetwork(30)
defer stopNetwork(nameservers, grouter)
// This subset will sometimes lose touch with some of the others
badNameservers := nameservers[45:]
badNameservers := nameservers[25:]
// This subset will remain well-connected, and we will deal mainly with them
nameservers = nameservers[:45]
nameservers = nameservers[:25]
nameserversByName := map[router.PeerName]*Nameserver{}
for _, n := range nameservers {
nameserversByName[n.ourName] = n
Expand Down Expand Up @@ -195,7 +195,7 @@ func testNameservers(t *testing.T) {
require.Equal(t, mapping.hostname, hostname)
}

for i := 0; i < 1000; i++ {
for i := 0; i < 800; i++ {
r := rand.Float32()
switch {
case r < 0.1:
Expand Down

0 comments on commit 6ee8e76

Please sign in to comment.