Bläddra i källkod

integration: fix decrease cluster tests

Yicheng Qin 10 år sedan
förälder
incheckning
87e3de8b8b
1 ändrade filer med 4 tillägg och 2 borttagningar
  1. 4 2
      integration/cluster_test.go

+ 4 - 2
integration/cluster_test.go

@@ -346,8 +346,10 @@ func (c *cluster) RemoveMember(t *testing.T, id uint64) {
 			select {
 			case <-m.s.StopNotify():
 				m.Terminate(t)
-			// 1s stop delay + election timeout + 1s disk and network delay
-			case <-time.After(time.Second + time.Duration(electionTicks)*tickDuration + time.Second):
+			// 1s stop delay + election timeout + 1s disk and network delay + connection write timeout
+			// TODO: remove connection write timeout by selecting on http response closeNotifier
+			// blocking on https://github.com/golang/go/issues/9524
+			case <-time.After(time.Second + time.Duration(electionTicks)*tickDuration + time.Second + rafthttp.ConnWriteTimeout):
 				t.Fatalf("failed to remove member %s in time", m.s.ID())
 			}
 		}