Repository navigation
fix ci port allocated - #17109
fix ci port allocated#17109
Conversation
2. modified unit_test file only run on python
📝 WalkthroughWalkthroughThe CI workflow now distinguishes Python-only unit-test changes from broader test changes. Infinity and Elasticsearch test setup steps use labeled per-port Docker guard networks with atomic reservation, rollback, stale cleanup, bounded retries, and matching teardown. ChangesCI test infrastructure
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related PRs
Suggested labels: Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
.github/workflows/sep-tests.yml (2)
405-514: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy liftExtract the duplicated
cleanup_stale_port_locks/reserve_port_offsetlogic into one shared source. This ~110-line, non-trivial port-guard algorithm is duplicated byte-for-byte between the Infinity and Elasticsearch jobs. Any future fix (e.g. thecreate_fail_streakchange above) must be applied in two places, and the copies will inevitably drift. Move it into a single checked-in script (sourced by both steps) or a local composite action, parameterized byDOC_ENGINE/PARTITION_BASE.
.github/workflows/sep-tests.yml#L405-L514: replace the inline Infinity block with a call into the shared script/action..github/workflows/sep-tests.yml#L978-L1085: replace the inline Elasticsearch block with the same shared call.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/sep-tests.yml around lines 405 - 514, Extract the duplicated cleanup_stale_port_locks and reserve_port_offset logic into one checked-in shared script or local composite action, parameterized by DOC_ENGINE and PARTITION_BASE while preserving the existing behavior. Replace the inline Infinity block in .github/workflows/sep-tests.yml lines 405-514 and the inline Elasticsearch block in .github/workflows/sep-tests.yml lines 978-1085 with calls to that shared implementation; both sites require direct changes.
501-508: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win
create_fail_streakconflates contention with hard failures and can abort reservation prematurely. The streak increments on anydocker network createfailure, including a name conflict when a competing runner legitimately claimed the port between snapshot and create. Under high parallel contention 10 consecutive such races will trip the abort at line ~505/1078 even though free offsets remain, turning recoverable contention into a hard CI failure. Consider distinguishing a name-conflict error (contention → keep retrying / don't count toward abort) from a genuinely hard error (daemon unreachable, subnet exhausted → abort), e.g. by inspectingcreate_err.
.github/workflows/sep-tests.yml#L501-L508: in the Infinityreserve_port_offset, only count non-name-conflictcreate_errtowardcreate_fail_streak(or reset it after any fast-path-clean attempt)..github/workflows/sep-tests.yml#L1074-L1081: apply the identical change to the Elasticsearchreserve_port_offsetcopy.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/sep-tests.yml around lines 501 - 508, The reserve_port_offset logic currently counts recoverable Docker network name conflicts as hard failures, allowing contention to trigger premature aborts. In both .github/workflows/sep-tests.yml:501-508 (Infinity) and .github/workflows/sep-tests.yml:1074-1081 (Elasticsearch), update the create_fail_streak handling to inspect create_err and count only non-name-conflict failures; continue retrying without incrementing the streak for name conflicts while preserving the existing abort threshold for genuine Docker errors.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In @.github/workflows/sep-tests.yml:
- Around line 405-514: Extract the duplicated cleanup_stale_port_locks and
reserve_port_offset logic into one checked-in shared script or local composite
action, parameterized by DOC_ENGINE and PARTITION_BASE while preserving the
existing behavior. Replace the inline Infinity block in
.github/workflows/sep-tests.yml lines 405-514 and the inline Elasticsearch block
in .github/workflows/sep-tests.yml lines 978-1085 with calls to that shared
implementation; both sites require direct changes.
- Around line 501-508: The reserve_port_offset logic currently counts
recoverable Docker network name conflicts as hard failures, allowing contention
to trigger premature aborts. In both .github/workflows/sep-tests.yml:501-508
(Infinity) and .github/workflows/sep-tests.yml:1074-1081 (Elasticsearch), update
the create_fail_streak handling to inspect create_err and count only
non-name-conflict failures; continue retrying without incrementing the streak
for name conflicts while preserving the existing abort threshold for genuine
Docker errors.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 5f670c62-5cfe-4662-bcc0-e71d8a7b0b7f
📒 Files selected for processing (1)
.github/workflows/sep-tests.yml
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #17109 +/- ##
=======================================
Coverage 90.65% 90.65%
=======================================
Files 10 10
Lines 717 717
Branches 118 118
=======================================
Hits 650 650
Misses 39 39
Partials 28 28 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary