1
0
mirror of https://github.com/redis/go-redis.git synced 2025-10-20 09:52:25 +03:00

give some time for the background to execute commands

This commit is contained in:
Nedyalko Dyakov
2025-10-17 16:46:20 +03:00
parent f8867759da
commit 72cf74a6be

View File

@@ -860,12 +860,15 @@ var _ = Describe("Credentials Provider Priority", func() {
client.AddHook(recorder.Hook()) client.AddHook(recorder.Hook())
// wrongpass // wrongpass
Expect(client.Ping(context.Background()).Err()).To(HaveOccurred()) Expect(client.Ping(context.Background()).Err()).To(HaveOccurred())
time.Sleep(10 * time.Millisecond)
Expect(recorder.Contains("AUTH initial_user")).To(BeTrue()) Expect(recorder.Contains("AUTH initial_user")).To(BeTrue())
// Update credentials // Update credentials
opt.StreamingCredentialsProvider.(*mockStreamingProvider).updates <- updatedCreds opt.StreamingCredentialsProvider.(*mockStreamingProvider).updates <- updatedCreds
// wrongpass // wrongpass
time.Sleep(10 * time.Millisecond)
Expect(client.Ping(context.Background()).Err()).To(HaveOccurred()) Expect(client.Ping(context.Background()).Err()).To(HaveOccurred())
time.Sleep(10 * time.Millisecond)
Expect(recorder.Contains("AUTH updated_user")).To(BeTrue()) Expect(recorder.Contains("AUTH updated_user")).To(BeTrue())
close(updatesChan) close(updatesChan)
}) })