wait for exit and release resource

release-0.4
Xiang Li 2013-08-15 10:23:23 -07:00 committed by Brandon Philips
parent c459b4bda7
commit 5bd24d8271
2 changed files with 7 additions and 4 deletions

View File

@ -292,7 +292,7 @@ func TestKillRandom(t *testing.T) {
toKill := make(map[int]bool)
for i := 0; i < 20; i++ {
fmt.Printf("TestKillRandom Round[%d/200]\n", i)
fmt.Printf("TestKillRandom Round[%d/20]\n", i)
j := 0
for {
@ -310,8 +310,11 @@ func TestKillRandom(t *testing.T) {
}
for num, _ := range toKill {
etcds[num].Kill()
etcds[num].Release()
err := etcds[num].Kill()
if err != nil {
panic(err)
}
etcds[num].Wait()
}
time.Sleep(ElectionTimeout)

View File

@ -96,7 +96,7 @@ func CreateCluster(size int, procAttr *os.ProcAttr, ssl bool) ([][]string, []*os
// have to retry. This retry can take upwards of 15 seconds
// which slows tests way down and some of them fail.
if i == 0 {
time.Sleep(time.Second)
time.Sleep(time.Second * 2)
}
}