Browse Source

Merge pull request #824 from unihorn/97

fix(remove_node_test): remove unnecessary cluster configuration
Yicheng Qin 11 years ago
parent
commit
5bfbf3a48c
1 changed files with 2 additions and 22 deletions
  1. 2 22
      tests/functional/remove_node_test.go

+ 2 - 22
tests/functional/remove_node_test.go

@@ -31,7 +31,7 @@ func TestRemoveNode(t *testing.T) {
 
 	c.SyncCluster()
 
-	resp, _ := tests.Put("http://localhost:7001/v2/admin/config", "application/json", bytes.NewBufferString(`{"activeSize":4, "syncInterval":1}`))
+	resp, _ := tests.Put("http://localhost:7001/v2/admin/config", "application/json", bytes.NewBufferString(`{"activeSize":4, "syncInterval":5}`))
 	if !assert.Equal(t, resp.StatusCode, 200) {
 		t.FailNow()
 	}
@@ -41,11 +41,6 @@ func TestRemoveNode(t *testing.T) {
 	client := &http.Client{}
 	for i := 0; i < 2; i++ {
 		for i := 0; i < 2; i++ {
-			r, _ := tests.Put("http://localhost:7001/v2/admin/config", "application/json", bytes.NewBufferString(`{"activeSize":3}`))
-			if !assert.Equal(t, r.StatusCode, 200) {
-				t.FailNow()
-			}
-
 			client.Do(rmReq)
 
 			fmt.Println("send remove to node3 and wait for its exiting")
@@ -76,12 +71,7 @@ func TestRemoveNode(t *testing.T) {
 				panic(err)
 			}
 
-			r, _ = tests.Put("http://localhost:7001/v2/admin/config", "application/json", bytes.NewBufferString(`{"activeSize":4}`))
-			if !assert.Equal(t, r.StatusCode, 200) {
-				t.FailNow()
-			}
-
-			time.Sleep(time.Second + time.Second)
+			time.Sleep(time.Second + 5*time.Second)
 
 			resp, err = c.Get("_etcd/machines", false, false)
 
@@ -96,11 +86,6 @@ func TestRemoveNode(t *testing.T) {
 
 		// first kill the node, then remove it, then add it back
 		for i := 0; i < 2; i++ {
-			r, _ := tests.Put("http://localhost:7001/v2/admin/config", "application/json", bytes.NewBufferString(`{"activeSize":3}`))
-			if !assert.Equal(t, r.StatusCode, 200) {
-				t.FailNow()
-			}
-
 			etcds[2].Kill()
 			fmt.Println("kill node3 and wait for its exiting")
 			etcds[2].Wait()
@@ -131,11 +116,6 @@ func TestRemoveNode(t *testing.T) {
 				panic(err)
 			}
 
-			r, _ = tests.Put("http://localhost:7001/v2/admin/config", "application/json", bytes.NewBufferString(`{"activeSize":4}`))
-			if !assert.Equal(t, r.StatusCode, 200) {
-				t.FailNow()
-			}
-
 			time.Sleep(time.Second + time.Second)
 
 			resp, err = c.Get("_etcd/machines", false, false)