Skip to content

Add explicit timeout to Eventually assertions in reconciler tests#1020

Merged
makkes merged 1 commit intofluxcd:mainfrom
IstvanCsVarga:fix/flaky-test-timeout
Mar 25, 2026
Merged

Add explicit timeout to Eventually assertions in reconciler tests#1020
makkes merged 1 commit intofluxcd:mainfrom
IstvanCsVarga:fix/flaky-test-timeout

Conversation

@IstvanCsVarga
Copy link
Copy Markdown
Contributor

@IstvanCsVarga IstvanCsVarga commented Mar 24, 2026

Fixes #899

Six Eventually calls in the reconciler tests were missing an explicit timeout, falling back to gomega's default of 1 second. This caused flaky failures when the reconciliation loop took slightly longer, as ObservedGeneration would still be -1 instead of the expected 1.

All other Eventually calls in the same file already use the 10-second timeout constant. This adds it to the 6 missing ones.

Confirmed the flaky failure reproduces without the fix (push update subtest, line 520) and the full suite passes with it.

Six Eventually calls in the reconciler tests were missing an explicit
timeout, falling back to gomega default of 1 second. This caused
flaky failures when the reconciliation loop took slightly longer than
1 second, as the ObservedGeneration would not yet be updated.

All other Eventually calls in the same file already use the 10-second
timeout constant defined at the top of the file.

Fixes: fluxcd#899

Signed-off-by: Istvan Csaba Varga <istvan.csaba.varga@accenture.com>
@makkes
Copy link
Copy Markdown
Member

makkes commented Mar 25, 2026

Looks good to me, I'll run the tests locally to verify.

Copy link
Copy Markdown
Member

@makkes makkes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks right to me

@makkes
Copy link
Copy Markdown
Member

makkes commented Mar 25, 2026

I'm not able to repro the original failure but this change should make it happen less often, anyway, so let's merge it.

@makkes makkes merged commit 1a95354 into fluxcd:main Mar 25, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flaky test "TestImageUpdateAutomationReconciler_Reconcile/no_marker_no_update"

2 participants