Skip to content

Commit f7a6ca3

Browse files
committed
fix(tests): simulate start/stop in mock credentials provider
1 parent c5054e2 commit f7a6ca3

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

redis_test.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -874,9 +874,12 @@ func (m *mockStreamingProvider) Subscribe(listener auth.CredentialsListener) (au
874874
if m.err != nil {
875875
return nil, nil, m.err
876876
}
877-
878-
// Send initial credentials
879-
listener.OnNext(m.credentials)
877+
select {
878+
case <-m.updates:
879+
// simulate start/stop
880+
m.updates = make(chan auth.Credentials, 1)
881+
default:
882+
}
880883

881884
// Start goroutine to handle updates
882885
go func() {

0 commit comments

Comments
 (0)