Skip to content

Commit 4c4f54b

Browse files
committed
Increase timeouts
Signed-off-by: Marko Mudrinić <mudrinic.mare@gmail.com>
1 parent a1041ba commit 4c4f54b

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

test/e2e/virtual/initializingworkspaces/virtualworkspace_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,12 +359,15 @@ func TestInitializingWorkspacesVirtualWorkspaceAccess(t *testing.T) {
359359
})
360360
}
361361

362+
// This loop needs longer timeout because SAR deny cache is refreshed every 30 seconds,
363+
// so it might take up to 30 seconds for the above RBAC changes to be reflected in authorization decisions.
364+
// Because of that, we can't use exactly 30 seconds as timeout, instead we use 1 minute to be on the safe side.
362365
t.Log("Ensure that LIST calls through the virtual workspace eventually show the correct values")
363366
for _, wsName := range wsNames {
364367
require.EventuallyWithT(t, func(c *assert.CollectT) {
365368
_, err := sourceKcpClusterClient.CoreV1alpha1().Cluster(wsPath.Join(wsName)).LogicalClusters().Get(ctx, corev1alpha1.LogicalClusterName, metav1.GetOptions{})
366369
require.NoError(c, err, "got %#v error getting logicalcluster %q, expected success", err, wsPath.Join(wsName))
367-
}, wait.ForeverTestTimeout, 100*time.Millisecond)
370+
}, 2*wait.ForeverTestTimeout, 100*time.Millisecond)
368371
}
369372

370373
for initializers, expected := range map[string][]tenancyv1alpha1.Workspace{

test/e2e/virtual/terminatingworkspaces/virtualworkspace_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,14 +356,17 @@ func TestTerminatingWorkspacesVirtualWorkspaceAccess(t *testing.T) {
356356
}, wait.ForeverTestTimeout, 100*time.Millisecond)
357357
}
358358

359+
// This loop needs longer timeout because SAR deny cache is refreshed every 30 seconds,
360+
// so it might take up to 30 seconds for the above RBAC changes to be reflected in authorization decisions.
361+
// Because of that, we can't use exactly 30 seconds as timeout, instead we use 1 minute to be on the safe side.
359362
t.Log("Ensure that LIST calls through the virtual workspace eventually show the correct values")
360363
for name := range workspaces {
361364
require.EventuallyWithT(t, func(c *assert.CollectT) {
362365
for _, client := range user1VwKcpClusterClients[name] {
363366
_, err := client.CoreV1alpha1().LogicalClusters().List(ctx, metav1.ListOptions{})
364367
require.NoError(c, err)
365368
}
366-
}, wait.ForeverTestTimeout, 100*time.Millisecond)
369+
}, 2*wait.ForeverTestTimeout, 100*time.Millisecond)
367370
}
368371

369372
alphaTerminator := string(termination.TerminatorForType(workspaceTypes["alpha"]))

0 commit comments

Comments
 (0)