mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #824 from unihorn/97
fix(remove_node_test): remove unnecessary cluster configuration
This commit is contained in:
commit
5bfbf3a48c
@ -31,7 +31,7 @@ func TestRemoveNode(t *testing.T) {
|
|||||||
|
|
||||||
c.SyncCluster()
|
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) {
|
if !assert.Equal(t, resp.StatusCode, 200) {
|
||||||
t.FailNow()
|
t.FailNow()
|
||||||
}
|
}
|
||||||
@ -41,11 +41,6 @@ func TestRemoveNode(t *testing.T) {
|
|||||||
client := &http.Client{}
|
client := &http.Client{}
|
||||||
for i := 0; i < 2; i++ {
|
for i := 0; i < 2; i++ {
|
||||||
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)
|
client.Do(rmReq)
|
||||||
|
|
||||||
fmt.Println("send remove to node3 and wait for its exiting")
|
fmt.Println("send remove to node3 and wait for its exiting")
|
||||||
@ -76,12 +71,7 @@ func TestRemoveNode(t *testing.T) {
|
|||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
r, _ = tests.Put("http://localhost:7001/v2/admin/config", "application/json", bytes.NewBufferString(`{"activeSize":4}`))
|
time.Sleep(time.Second + 5*time.Second)
|
||||||
if !assert.Equal(t, r.StatusCode, 200) {
|
|
||||||
t.FailNow()
|
|
||||||
}
|
|
||||||
|
|
||||||
time.Sleep(time.Second + time.Second)
|
|
||||||
|
|
||||||
resp, err = c.Get("_etcd/machines", false, false)
|
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
|
// first kill the node, then remove it, then add it back
|
||||||
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()
|
|
||||||
}
|
|
||||||
|
|
||||||
etcds[2].Kill()
|
etcds[2].Kill()
|
||||||
fmt.Println("kill node3 and wait for its exiting")
|
fmt.Println("kill node3 and wait for its exiting")
|
||||||
etcds[2].Wait()
|
etcds[2].Wait()
|
||||||
@ -131,11 +116,6 @@ func TestRemoveNode(t *testing.T) {
|
|||||||
panic(err)
|
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 + time.Second)
|
||||||
|
|
||||||
resp, err = c.Get("_etcd/machines", false, false)
|
resp, err = c.Get("_etcd/machines", false, false)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user