@@ -86,7 +86,7 @@ func TestStateWatcher_GetState_UnknownWhenEmpty(t *testing.T) {
8686 fakeClient := newFakeClient ()
8787 watcher := k8sapp .NewStateWatcher (newTestDeps (t ), fakeClient , testNamespace )
8888
89- info , ok := watcher .GetState (api .AppID ("app-123" ))
89+ info , ok := watcher .GetState (t . Context (), api .AppID ("app-123" ))
9090 assert .False (t , ok )
9191 assert .Empty (t , info .ActualState )
9292}
@@ -107,7 +107,7 @@ func TestStateWatcher_GetState_AfterCacheSync(t *testing.T) {
107107 watcher := k8sapp .NewStateWatcher (d , fakeClient , testNamespace )
108108
109109 assert .Eventually (t , func () bool {
110- info , ok := watcher .GetState (api .AppID ("app-123" ))
110+ info , ok := watcher .GetState (t . Context (), api .AppID ("app-123" ))
111111 return ok && info .ActualState == k8sapp .AppActualStateStopped
112112 }, 5 * time .Second , 50 * time .Millisecond )
113113}
@@ -128,7 +128,7 @@ func TestStateWatcher_WakeupApp(t *testing.T) {
128128
129129 // Wait for the informer to cache the object.
130130 require .Eventually (t , func () bool {
131- _ , ok := watcher .GetState (api .AppID ("app-123" ))
131+ _ , ok := watcher .GetState (t . Context (), api .AppID ("app-123" ))
132132 return ok
133133 }, 5 * time .Second , 50 * time .Millisecond )
134134
@@ -180,7 +180,7 @@ func TestStateWatcher_GetState_UpstreamTarget(t *testing.T) {
180180 var info k8sapp.AppInfo
181181 assert .Eventually (t , func () bool {
182182 var ok bool
183- info , ok = watcher .GetState (api .AppID ("app-123" ))
183+ info , ok = watcher .GetState (t . Context (), api .AppID ("app-123" ))
184184 return ok && info .UpstreamTarget != nil
185185 }, 5 * time .Second , 50 * time .Millisecond )
186186
@@ -205,11 +205,11 @@ func TestStateWatcher_GetState_UpstreamTarget_AbsentWhenMissing(t *testing.T) {
205205 watcher := k8sapp .NewStateWatcher (d , fakeClient , testNamespace )
206206
207207 assert .Eventually (t , func () bool {
208- _ , ok := watcher .GetState (api .AppID ("app-123" ))
208+ _ , ok := watcher .GetState (t . Context (), api .AppID ("app-123" ))
209209 return ok
210210 }, 5 * time .Second , 50 * time .Millisecond )
211211
212- info , ok := watcher .GetState (api .AppID ("app-123" ))
212+ info , ok := watcher .GetState (t . Context (), api .AppID ("app-123" ))
213213 require .True (t , ok )
214214 assert .Nil (t , info .UpstreamTarget )
215215}
@@ -271,7 +271,7 @@ func TestStateWatcher_GetState_E2BAccessToken(t *testing.T) {
271271 var info k8sapp.AppInfo
272272 assert .Eventually (t , func () bool {
273273 var ok bool
274- info , ok = watcher .GetState (api .AppID ("app-e2b" ))
274+ info , ok = watcher .GetState (t . Context (), api .AppID ("app-e2b" ))
275275 return ok && info .E2BAccessToken != ""
276276 }, 5 * time .Second , 50 * time .Millisecond )
277277
@@ -294,11 +294,11 @@ func TestStateWatcher_GetState_E2BAccessToken_MissingSecret(t *testing.T) {
294294 watcher := k8sapp .NewStateWatcher (d , fakeClient , testNamespace )
295295
296296 assert .Eventually (t , func () bool {
297- _ , ok := watcher .GetState (api .AppID ("app-e2b" ))
297+ _ , ok := watcher .GetState (t . Context (), api .AppID ("app-e2b" ))
298298 return ok
299299 }, 5 * time .Second , 50 * time .Millisecond )
300300
301- info , ok := watcher .GetState (api .AppID ("app-e2b" ))
301+ info , ok := watcher .GetState (t . Context (), api .AppID ("app-e2b" ))
302302 require .True (t , ok )
303303 assert .Empty (t , info .E2BAccessToken )
304304}
@@ -319,11 +319,11 @@ func TestStateWatcher_GetState_NonE2BApp_NoToken(t *testing.T) {
319319 watcher := k8sapp .NewStateWatcher (d , fakeClient , testNamespace )
320320
321321 assert .Eventually (t , func () bool {
322- _ , ok := watcher .GetState (api .AppID ("app-regular" ))
322+ _ , ok := watcher .GetState (t . Context (), api .AppID ("app-regular" ))
323323 return ok
324324 }, 5 * time .Second , 50 * time .Millisecond )
325325
326- info , ok := watcher .GetState (api .AppID ("app-regular" ))
326+ info , ok := watcher .GetState (t . Context (), api .AppID ("app-regular" ))
327327 require .True (t , ok )
328328 assert .Empty (t , info .E2BAccessToken )
329329}
0 commit comments