Skip to content

Commit e59f758

Browse files
adjusted unit tests
1 parent c81a043 commit e59f758

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

pkg/registry/service_test.go

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,19 @@ type ServiceRegistryTestSuite struct {
2828

2929
func (s *ServiceRegistryTestSuite) TestGetNotificationCenter() {
3030
// empty state, make sure we get a new notification center
31-
sdkKey := "sdk_key_1"
32-
notificationCenter := GetNotificationCenter(sdkKey)
31+
sdkKey1 := "sdk_key_1"
32+
sdkKey2 := "sdk_key_2"
33+
notificationCenter := GetNotificationCenter(sdkKey1)
3334
s.NotNil(notificationCenter)
3435

35-
notificationCenter2 := GetNotificationCenter(sdkKey)
36+
notificationCenter2 := GetNotificationCenter(sdkKey1)
37+
s.Equal(notificationCenter, notificationCenter2)
38+
39+
// make sure sdkKey2 does not cause race condition
40+
notificationCenter = GetNotificationCenter(sdkKey2)
41+
s.NotNil(notificationCenter)
42+
43+
notificationCenter2 = GetNotificationCenter(sdkKey2)
3644
s.Equal(notificationCenter, notificationCenter2)
3745
}
3846

0 commit comments

Comments
 (0)