Browse Source

raft: Fixed a test misassumption

network_test.go:56: total = 59.22354ms, want > 50ms
59 is > 50, but the equation added 10 to the right side
Matt Keller 10 years ago
parent
commit
32372e1d70
1 changed files with 1 additions and 1 deletions
  1. 1 1
      raft/rafttest/network_test.go

+ 1 - 1
raft/rafttest/network_test.go

@@ -52,7 +52,7 @@ func TestNetworkDelay(t *testing.T) {
 
 
 	w := time.Duration(float64(sent)*delayrate/2) * delay
 	w := time.Duration(float64(sent)*delayrate/2) * delay
 	// there are pretty overhead in the send call, since it genarete random numbers.
 	// there are pretty overhead in the send call, since it genarete random numbers.
-	if total < w+10*delay {
+	if total < w {
 		t.Errorf("total = %v, want > %v", total, w)
 		t.Errorf("total = %v, want > %v", total, w)
 	}
 	}
 }
 }