mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etcd: remove skipped test
This commit is contained in:
parent
d71865e094
commit
0ba26afb4d
@ -286,61 +286,9 @@ func BenchmarkEndToEndSet(b *testing.B) {
|
|||||||
destoryCluster(nil, es, hs)
|
destoryCluster(nil, es, hs)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(yichengq): cannot handle previous msgDenial correctly now
|
// TestModeSwitch tests switch mode between standby and peer.
|
||||||
func TestModeSwitch(t *testing.T) {
|
func TestModeSwitch(t *testing.T) {
|
||||||
t.Skip("not passed")
|
t.Skip("not implemented")
|
||||||
size := 5
|
|
||||||
round := 3
|
|
||||||
|
|
||||||
for i := 0; i < size; i++ {
|
|
||||||
es, hs := buildCluster(size, false)
|
|
||||||
waitCluster(t, es)
|
|
||||||
|
|
||||||
cfg := conf.NewClusterConfig()
|
|
||||||
cfg.SyncInterval = 0
|
|
||||||
id := int64(i)
|
|
||||||
for j := 0; j < round; j++ {
|
|
||||||
lead, _ := waitActiveLeader(es)
|
|
||||||
// cluster only demotes follower
|
|
||||||
if lead == id {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
cfg.ActiveSize = size - 1
|
|
||||||
if err := es[lead].p.setClusterConfig(cfg); err != nil {
|
|
||||||
t.Fatalf("#%d: setClusterConfig err = %v", i, err)
|
|
||||||
}
|
|
||||||
if err := es[lead].p.remove(id); err != nil {
|
|
||||||
t.Fatalf("#%d: remove err = %v", i, err)
|
|
||||||
}
|
|
||||||
|
|
||||||
waitMode(standbyMode, es[i])
|
|
||||||
|
|
||||||
for k := 0; k < 4; k++ {
|
|
||||||
if es[i].s.leader != noneId {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
time.Sleep(20 * time.Millisecond)
|
|
||||||
}
|
|
||||||
if g := es[i].s.leader; g != lead {
|
|
||||||
t.Errorf("#%d: lead = %d, want %d", i, g, lead)
|
|
||||||
}
|
|
||||||
|
|
||||||
cfg.ActiveSize = size
|
|
||||||
if err := es[lead].p.setClusterConfig(cfg); err != nil {
|
|
||||||
t.Fatalf("#%d: setClusterConfig err = %v", i, err)
|
|
||||||
}
|
|
||||||
|
|
||||||
waitMode(participantMode, es[i])
|
|
||||||
|
|
||||||
if err := checkParticipant(i, es); err != nil {
|
|
||||||
t.Errorf("#%d: check alive err = %v", i, err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
destoryCluster(t, es, hs)
|
|
||||||
}
|
|
||||||
afterTest(t)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sending set commands
|
// Sending set commands
|
||||||
|
@ -565,27 +565,6 @@ func waitMode(mode int64, e *Server) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// checkParticipant checks the i-th server works well as participant.
|
|
||||||
func checkParticipant(i int, es []*Server) error {
|
|
||||||
lead, _ := waitActiveLeader(es)
|
|
||||||
key := fmt.Sprintf("/%d", rand.Int31())
|
|
||||||
ev, err := es[lead].p.Set(key, false, "bar", store.Permanent)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
w, err := es[i].p.Watch(key, false, false, ev.Index())
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
select {
|
|
||||||
case <-w.EventChan:
|
|
||||||
case <-time.After(8 * defaultHeartbeat * es[i].tickDuration):
|
|
||||||
return fmt.Errorf("watch timeout")
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func newTestConfig() *conf.Config {
|
func newTestConfig() *conf.Config {
|
||||||
c := conf.New()
|
c := conf.New()
|
||||||
c.Addr = "127.0.0.1:0"
|
c.Addr = "127.0.0.1:0"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user