@@ -39,8 +39,7 @@ func TestSaCache(t *testing.T) {
3939
4040 resp := cache .Get (Request {Name : "default" , Namespace : "default" })
4141
42- assert .False (t , resp .FoundInCMCache , "Expected no cache entry to be found" )
43- assert .False (t , resp .FoundInSACache , "Expected no cache entry to be found" )
42+ assert .False (t , resp .FoundInCache , "Expected no cache entry to be found" )
4443 if resp .RoleARN != "" || resp .Audience != "" {
4544 t .Errorf ("Expected role and aud to be empty, got %v" , resp )
4645 }
@@ -49,7 +48,7 @@ func TestSaCache(t *testing.T) {
4948
5049 resp = cache .Get (Request {Name : "default" , Namespace : "default" })
5150
52- assert .True (t , resp .FoundInSACache , "Expected cache entry to be found" )
51+ assert .True (t , resp .FoundInCache , "Expected cache entry to be found" )
5352 assert .Equal (t , roleArn , resp .RoleARN , "Expected role to be %s, got %s" , roleArn , resp .RoleARN )
5453 assert .Equal (t , "sts.amazonaws.com" , resp .Audience , "Expected aud to be sts.amzonaws.com, got %s" , resp .Audience )
5554 assert .True (t , resp .UseRegionalSTS , "Expected regional STS to be true, got false" )
@@ -77,8 +76,7 @@ func TestNotification(t *testing.T) {
7776
7877 // test that the requested SA is not in the cache
7978 resp := cache .Get (reqWithoutNotification )
80- assert .False (t , resp .FoundInSACache , "Expected no cache entry to be found in SA cache" )
81- assert .False (t , resp .FoundInCMCache , "Expected no cache entry to be found in CM cache" )
79+ assert .False (t , resp .FoundInCache , "Expected no cache entry to be found in cache" )
8280
8381 // fetch with notification
8482 resp = cache .Get (reqWithNotification )
@@ -100,7 +98,7 @@ func TestNotification(t *testing.T) {
10098 // expected
10199 // test that the requested SA is now in the cache
102100 resp := cache .Get (reqWithoutNotification )
103- assert .True (t , resp .FoundInSACache , "Expected cache entry to be found in SA cache" )
101+ assert .True (t , resp .FoundInCache , "Expected cache entry to be found in cache" )
104102 case <- time .After (1 * time .Second ):
105103 t .Fatal ("timeout waiting for notification" )
106104 }
@@ -115,8 +113,7 @@ func TestNotification(t *testing.T) {
115113
116114 // test that the requested SA is not in the cache
117115 resp := cache .Get (reqWithoutNotification )
118- assert .False (t , resp .FoundInSACache , "Expected no cache entry to be found in SA cache" )
119- assert .False (t , resp .FoundInCMCache , "Expected no cache entry to be found in CM cache" )
116+ assert .False (t , resp .FoundInCache , "Expected no cache entry to be found in cache" )
120117
121118 // fetch with notification
122119 resp = cache .Get (reqWithNotification )
@@ -126,17 +123,18 @@ func TestNotification(t *testing.T) {
126123 for i := 0 ; i < 10 ; i ++ {
127124 wg .Add (1 )
128125 go func () {
126+ defer wg .Done ()
127+
129128 // wait for the notification
130129 select {
131130 case <- resp .Notifier :
132131 // expected
133132 // test that the requested SA is now in the cache
134133 resp := cache .Get (reqWithoutNotification )
135- assert .True (t , resp .FoundInSACache , "Expected cache entry to be found in SA cache" )
134+ assert .True (t , resp .FoundInCache , "Expected cache entry to be found in cache" )
136135 case <- time .After (1 * time .Second ):
137136 t .Error ("timeout waiting for notification" )
138137 }
139- wg .Done ()
140138 }()
141139 }
142140
@@ -261,7 +259,7 @@ func TestNonRegionalSTS(t *testing.T) {
261259 }
262260
263261 resp := cache .Get (Request {Name : "default" , Namespace : "default" })
264- assert .True (t , resp .FoundInSACache , "Expected cache entry to be found" )
262+ assert .True (t , resp .FoundInCache , "Expected cache entry to be found" )
265263 if resp .RoleARN != roleArn {
266264 t .Errorf ("got roleArn %v, expected %v" , resp .RoleARN , roleArn )
267265 }
0 commit comments