Skip to content

fix: stabilize flaky failover attempts test - #4482

Merged
ggivo merged 5 commits into
redis:masterfrom
Ra9huvansh:fix-4428-flaky-failover-attempts-test
Apr 29, 2026
Merged

ggivo merged 5 commits into
redis:masterfrom
Ra9huvansh:fix-4428-flaky-failover-attempts-test

Conversation

@Ra9huvansh

@Ra9huvansh Ra9huvansh commented Apr 8, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #4428

Problem

MultiDbConnectionProviderFailoverAttemptsConfigTest.delayBetweenFailoverAttempts_permanentExceptionAfterAttemptsExhausted was flaky in CI with: expected: <1> but was: <2>

The test used a 20ms freeze window. The 50-iteration rapid loop could take longer than 20ms on a loaded CI machine, causing the freeze window to expire mid-loop. When that happened, markAsFreeze() succeeded again and incremented failoverAttemptCount to 2, failing the assertEquals(1, ...) assertion.

Fix

  • Increase delayMs from 20ms to 200ms so the rapid loop always completes within the freeze window
  • Increase atMost from 200ms to 2s proportionally, since the await() block must wait for the (now longer) freeze window to expire
  • Relax pollInterval from 10ms to 50ms accordingly
  • Remove now-unused import org.awaitility.Durations

No production code changes.


Note

Low Risk
Low risk: test-only timing adjustments to reduce CI flakiness; no production logic changes.

Overview
Stabilizes MultiDbConnectionProviderFailoverAttemptsConfigTest.delayBetweenFailoverAttempts_permanentExceptionAfterAttemptsExhausted by widening the failover delay window (20ms οΏ½ 200ms) so the rapid retry loop stays within the freeze period.

Updates the Awaitility wait/poll timings to match the longer window and removes the unused org.awaitility.Durations import.

Reviewed by Cursor Bugbot for commit bc24549. Bugbot is set up for automated code reviews on this repo. Configure here.

@jit-ci

jit-ci Bot commented Apr 8, 2026

Copy link
Copy Markdown

Hi, I’m Jit, a friendly security platform designed to help developers build secure applications from day zero with an MVS (Minimal viable security) mindset.

In case there are security findings, they will be communicated to you as a comment inside the PR.

Hope you’ll enjoy using Jit.

Questions? Comments? Want to learn more? Get in touch with us.

@atakavci

atakavci commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

hey @Ra9huvansh ,

thanks for picking this up!
Though this doesn't seem to show up recently, its nice to work on for more stable pipeline.
Let me give it a go for pending workflows.
Meanwhile, lets think about if there is a any better way rather than tuning those durations or relying on timing at all.

@Ra9huvansh

Ra9huvansh commented Apr 9, 2026 •

Copy link
Copy Markdown
Contributor Author

hi @atakavci, yes indeed relying on just timing is fragile. What could be a better approach? Do you have anything in mind? Also sorry about the formatter, will make sure to run it before pushing next time.

@atakavci atakavci left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@ggivo
ggivo merged commit bdbf5d4 into redis:master Apr 29, 2026
15 of 16 checks passed
@ggivo ggivo added the testing label May 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix flaky test MultiDbConnectionProviderFailoverAttemptsConfigTest.delayBetweenFailoverAttempts_permanentExceptionAfterAttemptsExhausted

3 participants