Skip to content

Commit

Permalink
address comments from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross committed Apr 14, 2022
1 parent f30e8a8 commit ae1b029
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions client/dynamicplugins/registry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func TestPluginEventBroadcaster_SendsMessagesToAllClients(t *testing.T) {
for {
select {
case <-ctx.Done():
t.Fail()
t.Errorf("did not receive event on both subscriptions before timeout")
return
case <-ch1:
rcv1 = true
Expand All @@ -53,7 +53,6 @@ func TestPluginEventBroadcaster_UnsubscribeWorks(t *testing.T) {

b := newPluginEventBroadcaster()
defer close(b.stopCh)
var rcv1 bool

ch1 := b.subscribe()

Expand All @@ -67,13 +66,10 @@ func TestPluginEventBroadcaster_UnsubscribeWorks(t *testing.T) {
for {
select {
case <-ctx.Done():
t.Fail()
t.Errorf("did not receive unsubscribe event on subscription before timeout")
return
case <-ch1:
rcv1 = true
if rcv1 {
return
}
return // done!
}
}
}()
Expand All @@ -100,7 +96,7 @@ func TestDynamicRegistry_RegisterPlugin_SendsUpdateEvents(t *testing.T) {
for {
select {
case <-ctx.Done():
t.Fail()
t.Errorf("did not receive registration event on subscription before timeout")
return
case e := <-ch:
if e != nil && e.EventType == EventTypeRegistered {
Expand Down Expand Up @@ -137,7 +133,7 @@ func TestDynamicRegistry_DeregisterPlugin_SendsUpdateEvents(t *testing.T) {
for {
select {
case <-ctx.Done():
t.Fail()
t.Errorf("did not receive deregistration event on subscription before timeout")
return
case e := <-ch:
if e != nil && e.EventType == EventTypeDeregistered {
Expand Down

0 comments on commit ae1b029

Please sign in to comment.