Skip to content

ci: add retry for flaky network operations (cargo test, docker compose)#7703

Open
TennyZhuang wants to merge 2 commits into
mainfrom
ci/retry-flaky-network
Open

ci: add retry for flaky network operations (cargo test, docker compose)#7703
TennyZhuang wants to merge 2 commits into
mainfrom
ci/retry-flaky-network

Conversation

@TennyZhuang
Copy link
Copy Markdown
Contributor

Rationale

We observed flaky CI failures caused by transient network issues:

  1. cargo test failing to fetch crates from crates.io (SSL EOF, HTTP2 framing errors)
  2. docker compose up failing to pull images from Docker Hub (connection timeout, registry access denied)

These failures are unrelated to code changes and waste CI time on retries.

Changes

  • .github/actions/test_behavior_core/action.yaml: Wrap cargo test in a retry loop (3 attempts, exponential backoff)
  • .github/services/hdfs_native/hdfs_native_cluster/action.yml: Wrap docker compose up in a retry loop (3 attempts, exponential backoff, clean up on failure)

Testing

The retry logic is conservative: 3 attempts with sleep(i * 10) backoff, which should handle most transient network blips without significantly extending CI time for persistent failures.

@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. releases-note/ci The PR modifies CI-related content or has a title that begins with "ci" labels Jun 7, 2026
Copy link
Copy Markdown
Member

@tisonkun tisonkun left a comment

Choose a reason for hiding this comment

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

+1 for docker compose retey

-1 for test retry

CI can be re run with a empty commit or committer's triggering on UI.

Retry tests may hide the real issue. For certain unstable tests, we can add retry in the test cases instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

releases-note/ci The PR modifies CI-related content or has a title that begins with "ci" size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants