Skip to content

Commit c5acb1c

Browse files
Merge pull request #5652 from umohnani8/fix-e2e-ocl-intermittent-failures
NO-ISSUE: Fix cleanup verification timeouts in e2e-ocl tests
2 parents 76ef5eb + 5b2e93d commit c5acb1c

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

test/e2e-ocl/helpers_test.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,12 @@ func cleanupEphemeralBuildObjects(t *testing.T, cs *framework.ClientSet) {
313313
moscList, err := cs.MachineconfigurationV1Interface.MachineOSConfigs().List(context.TODO(), metav1.ListOptions{})
314314
require.NoError(t, err)
315315

316-
kubeassert := helpers.AssertClientSet(t, cs)
316+
// Create a dedicated context for cleanup verification with reasonable timeout.
317+
// Cleanup should complete quickly - if verification takes >2 minutes, something is wrong.
318+
// Use a slower poll interval (3s instead of 1s) to reduce API call rate and avoid rate limiting.
319+
cleanupCtx, cleanupCancel := context.WithTimeout(context.Background(), 2*time.Minute)
320+
defer cleanupCancel()
321+
kubeassert := helpers.AssertClientSet(t, cs).WithContext(cleanupCtx).WithPollInterval(3 * time.Second).Eventually()
317322

318323
if len(secretList.Items) == 0 {
319324
t.Logf("No build-time secrets to clean up")

0 commit comments

Comments
 (0)