diff --git a/pkg/naming/zookeeper/zookeeper_test.go b/pkg/naming/zookeeper/zookeeper_test.go index 192bc1883..0539d8f2a 100644 --- a/pkg/naming/zookeeper/zookeeper_test.go +++ b/pkg/naming/zookeeper/zookeeper_test.go @@ -28,13 +28,13 @@ func TestZookeeper(t *testing.T) { if err != nil { t.Fatal(err) } - res := zk.Build(_testAppid) - event := res.Watch() _, err = zk.Register(context.TODO(), _testIns) if err != nil { t.Fatal(err) } - <-event + // fetch&watch + res := zk.Build(_testAppid) + event := res.Watch() <-event in, ok := res.Fetch(context.TODO()) if !ok {