test: Migrate WaitStarted to V3 API

This commit is contained in:
Marek Siarkowicz 2022-01-20 17:02:20 +01:00
parent ee6306b9f9
commit 81490c25d1

View File

@ -1065,11 +1065,9 @@ func (m *Member) WaitOK(t testutil.TB) {
}
func (m *Member) WaitStarted(t testutil.TB) {
cc := MustNewHTTPClient(t, []string{m.URL()}, m.ClientTLSInfo)
kapi := client.NewKeysAPI(cc)
for {
ctx, cancel := context.WithTimeout(context.Background(), RequestTimeout)
_, err := kapi.Get(ctx, "/", nil)
_, err := m.Client.Get(ctx, "/", clientv3.WithSerializable())
if err != nil {
time.Sleep(TickDuration)
continue