Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wait for the member to get started #19230

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions tests/common/auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,10 @@ func TestAuthGracefulDisable(t *testing.T) {
donec := make(chan struct{})
rootAuthClient := testutils.MustClient(clus.Client(WithAuth(rootUserName, rootPassword)))

startedC := make(chan struct{}, 1)
go func() {
defer close(donec)
defer close(startedC)
// sleep a bit to let the watcher connects while auth is still enabled
time.Sleep(time.Second)
// now disable auth...
Expand All @@ -112,10 +114,13 @@ func TestAuthGracefulDisable(t *testing.T) {
t.Errorf("failed to restart member %v", err)
return
}
startedC <- struct{}{}
// the watcher should still work after reconnecting
assert.NoErrorf(t, rootAuthClient.Put(ctx, "key", "value", config.PutOptions{}), "failed to put key value")
}()

<-startedC

wCtx, wCancel := context.WithCancel(ctx)
defer wCancel()

Expand Down
Loading