[ci] Auto-rerun flaky integration-test jobs on a fresh runner#895
[ci] Auto-rerun flaky integration-test jobs on a fresh runner#895weiqingy wants to merge 1 commit into
Conversation
The integration-test jobs depend on a live local Ollama server whose llama-server runner intermittently segfaults (~20% per job) and on a PyFlink py4j gateway that occasionally dies on flink-1.20. Both failures are environmental, per-runner, and version-neutral, and both survive the in-suite reruns already configured (pytest --reruns 2 / surefire rerunFailingTestsCount=2) because those retry into the same wedged process. Add a workflow_run companion that, when the CI run fails, re-runs only the failed integration-test jobs on a fresh runner, which resets the whole job environment and clears the flake. Unit-test, lint, and build failures are never re-run, so a real regression there stays red immediately. Bounded by run_attempt so a genuinely broken job still goes red instead of looping.
|
Note on this PR's own CI, to avoid a misread: the two red legs ( This PR cannot demonstrate the fix on its own CI: a I validated the mechanism end-to-end on a fork (companion on the fork's default branch): a failed integration-test-named job was re-run on a fresh runner and the run flipped green, a non-matching job was left untouched, and the |
Linked issue: #893
Purpose of change
The integration-test jobs (
it-python,it-java,cross-language) depend on a live local Ollama server and, on flink-1.20, a PyFlink py4j gateway. Both fail intermittently for environmental reasons: thellama-serverrunner segfaults (~20% per job) and the py4j gateway occasionally dies. Both survive the in-suite reruns already configured (pytest--reruns 2, surefirererunFailingTestsCount=2), because within one job those retry into the same wedged process.These failures are per-runner and version-neutral — the same job passes on ~80% of fresh runners, and across a run the failures roam between matrix jobs rather than pinning to one. The flake also has a dated onset with no matching Ollama release (the installed version has been constant across both the green and the red days), so it tracks the runner environment rather than a version regression. The reliable way to clear them is therefore a fresh runner, not a larger in-suite retry count, an in-process restart, or an Ollama version pin.
This adds a
workflow_runcompanion that, when the CI run finishes in failure, re-runs only the failed integration-test jobs on a fresh runner, which resets the whole job environment. Unit-test, lint, and build failures are never re-run, so a real regression there stays red immediately. The retry is bounded byrun_attempt(at most two re-runs) so a genuinely broken job — which fails on every fresh runner — still goes red instead of looping.Tests
The mechanism was validated end-to-end on a fork: a failed job matching the integration-test filter is re-run on a fresh runner and the run flips green, a non-matching job is left untouched, and the
run_attemptcap stops the retry chain. The job-name filter was checked against the current CI job names, so onlyit-python/it-java/cross-languagematch; the unit-test jobs (ut-python/ut-java),Code Style Check,install.sh tests, andut-build-backendare excluded.Two operational notes for reviewers: the companion needs
actions: writeon the workflow token to re-run jobs (the existing labeler companions already run on write-scoped tokens), and becauseworkflow_runcompanions execute from the default branch, this takes effect after merge and cannot be exercised on this PR's own CI.API
No public API changes; this only affects CI.
Documentation
doc-neededdoc-not-neededdoc-included