Repository navigation
test(cli): bind ephemeral loopback port in container-mode tests (#13775) - #13778
Conversation
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Autofix E2E Report â Issue #13775SummaryMain CI (
These are the only two tests in the file â and, after this fix, in the package â that bind the hard-coded container port Root cause
Reproduction (before the fix)With a throwaway holder process occupying the port ( Exactly the two tests from the issue failed; every other test in the file passed. FixTest-only change in
No production code was modified. Verification
Environment note: the exact CI failure was host-specific (shared äļæčŊīæAutofix E2E æĨå â Issue #13775æčĶäļŧåæŊ CI(
čŋäļĪäļŠæŊčŊĨæäŧķäļââäŧĨåæŽæŽĄäŋŪåĪåæīäļŠå
äļââäŧ
æįįåŪįŧåŪįĄŽįžį åŪđåĻįŦŊåĢ æ đå
åĪį°(äŋŪåĪå)įĻäļäļŠäļīæķčŋįĻå įĻčŊĨįŦŊåĢ( æ°åĨ―æŊ issue äļååšįäļĪäļŠæĩčŊåĪąčīĨ,æäŧķäļå ķä―æĩčŊå ĻéĻéčŋã äŋŪåĪäŧ
äŋŪæđ
æŠäŋŪæđäŧŧä―įäš§äŧĢį ã éŠčŊ
įŊåĒčŊīæ:įĄŪåį CI åĪąčīĨæŊäļŧæšįļå
ģį(å
ąäšŦ ð§ Handled by Qwen Code · model/æĻĄå |
|
â Qwen Triage finished â view run. See the stage comments in this thread for the result. â Qwen Triage å·ēåŪæ ââ æĨįčŋčĄãįŧæč§æŽįšŋįĻäļįåéķæŪĩčŊčŪšã |
|
Thanks for the PR. This is a re-run, and the head has moved since my last pass ( Template looks good â â all nine headings present, and the Risk & Scope section states the coverage trade plainly instead of burying it. Problem: observed, not theoretical. Issue #13775 is a real Direction: aligned. A hard-coded port in a suite that runs on hosts with neighbours is a flake generator by construction, and CI reliability is squarely in scope. CHANGELOG: no direct reference, but the area is relevant â this is test-suite hygiene with no user-facing surface. Size: not applicable. No core paths â both changed files are Approach: minimal, and it reuses an existing precedent rather than inventing a mechanism. I checked the completeness question that actually matters here â whether some other test still binds 43190 for real, which would leave the flake half-fixed. Grepping the tree for One scope question, offered as a question rather than an objection: commit Risk: no elevated risk signals. Stage 1e matched nothing; both paths are excluded as Moving on to code review. ð äļæčŊīææč°ĒčīĄįŪãčŋæŊäļæŽĄ re-runïžhead čŠæäļæŽĄåŪĄæĨåå·ēįŧį§ŧåĻïž æĻĄæŋåŪæī â ââ äđäļŠæ éĒé―å ĻïžRisk & Scope éĻåæčĶįéĒäļįåččŪēåūåūæļ æĨïžæēĄæåéŋã éŪéĒïžå·ēč§æĩå°ïžäļæŊįčŪšæ§įã issue #13775 æŊäļæŽĄįåŪį æđåïžåŊđé―ãåĻäļäļŠäļéŧåą å ąäšŦäļŧæšįæĩčŊåĨäŧķéįĄŽįžį įŦŊåĢïžæŽčšŦå°ąæŊæåĻæĨæšïžCI įĻģåŪæ§åŪå ĻåąäšæŽéĄđįŪčåīãCHANGELOGïžæ įīæĨåžįĻïžä―čŊĨéĒåįļå ģ ââ čŋæŊæĩčŊåĨäŧķåąéĒįåŦįéŪéĒïžæēĄæįĻæ·åŊč§éĒã č§æĻĄïžäļéįĻãæŠč§Ķåæ ļåŋč·Ŋåū ââ äļĪäļŠæđåĻæäŧķé―æŊ æđæĄïžæđåĻåūå°ïžäļåĪįĻäšæĒæå
äūčæēĄæåĶé æšåķãææ ļæĨäščŋéįæĢå
ģéŪįåŪæīæ§éŪéĒ ââ æŊåĶčŋæå
ķäŧæĩčŊäŧåĻįåŪįŧåŪ 43190ïžéĢæ ·æåĻå°ąåŠäŋŪäšäļåãåĻæīäļŠäŧĢį æ äļæįīĒ äļäļŠčåīäļįįéŪïžæŊæéŪčäļæŊååŊđïžæäšĪ éĢéĐïžæ åįš§éĢéĐäŋĄå·ãStage 1e æŠå―äļäŧŧä―æĻĄåžïžäļĪäļŠč·ŊåūåĻéŦéĢéĐæĻĄåžæĢæĨčŋčĄäđåå°ąå·ēčĒŦ čŋå ĨäŧĢį åŪĄæĨ ð â Qwen Code · qwen3.8-max-2026-09-02 Reviewed at |
Code reviewMy independent proposal last round was the same shape this PR took â spy on Both witnesses now hold, and I checked each against production rather than against the description:
Two smaller things I verified because a prototype-level mock is easy to get subtly wrong:
Non-blocking nit, not worth a round trip on a test-only change: The residual the PR discloses is real and I accept it: no test now proves a genuine bind to 43190 succeeds inside a container. That proof was the flake, so removing it is the fix rather than a side effect. If we ever want it back it belongs in an isolated lane with the port guaranteed free â not in a shared unit suite running on a host with neighbours. On conventions: the helper's comment is the kind AGENTS.md actually asks for â it explains a non-obvious why (the port is deliberately not really bound, and forcing loopback would make the URL assertion self-referential), which is exactly what stops a future reader "fixing" it back into a flake. Type-only import via Test evidenceThis is a CI-path re-run ( The load-bearing one is The author's local vitest counts and mutation probes are their own claim and I did not lean on them for the verdict â I verified both witnesses statically by reading production and the assertions, so nothing in my conclusion rests on a result I could not check myself.
Real-scenario testing: N/A â nothing user-visible (test-only, zero production lines), and on the CI path the live-behaviour signal comes from the PR's own checks above rather than from a locally driven session. There is also no behavioural claim left for a sandboxed lane to settle: the port witness follows from how a spy records call arguments, the host witness follows from the mock forwarding the requested host while production hard-codes loopback in the URL, and the suite's green state comes from the job that previously flaked. äļæčŊīæäŧĢį åŪĄæĨæäļäļč―ŪįįŽįŦæđæĄäļæŽ PR éįĻįå―Ēåžįļå ââ spy äļĪäļŠč§čŊį°åĻé―æįŦïžäļæé―æŊåŊđįįäš§äŧĢį æ ļåŊđįïžčäļæŊåŊđį PR æčŋ°ïž
åĶåĪäļĪįđæįđææ ļåŪäšïžå äļš prototype įš§åŦį mock åūåŪđæåšåūŪåĶįéïž
äļäļŠäļéŧåĄįå°įđïžåĻįšŊæĩčŊæđåĻäļäļåžåūåĪčĩ°äļč―Ūïž PR čŠå·ąæŦéēįæŪįįĄŪåŪååĻïžæäđæĨåïžį°åĻæēĄææĩčŊč―čŊæåŪđåĻå įåŪįŧåŪ 43190 äžæåãčéĢäļŠčŊææŽčšŦå°ąæŊæåĻæĨæšïžæäŧĨį§ŧéĪåŪæŊæŽæŽĄäŋŪåĪįįŪįïžäļæŊåŊä―įĻãåĶæå°æĨæģčĄĨåæĨïžåščŊĨæūåĻč―äŋčŊįŦŊåĢįĐšéēįéįĶŧéééïžčäļæŊæūåĻäļéŧåą å ąäšŦäļŧæšįåå æĩčŊåĨäŧķäļã č§čæđéĒïžhelper äļæđéĢæŪĩæģĻéæĢæŊ AGENTS.md æčĶæąįéĢäļįąŧ ââ åŪč§ĢéäšäļæūįķįäļšäŧäđïžįŦŊåĢæŊæ
æäļįåŪįŧåŪįïžčåžšåķåįŊäžä―ŋ URL æčĻéåäļščŠčŊïžïžčŋæ°æ°æŊéŧæĒåæĨč
æåŪ"äŋŪ"åæåĻįķææéčĶįäŋĄæŊãįąŧååŊžå
Ĩä―ŋįĻ æĩčŊčŊæŪčŋæŊäļæŽĄ CI č·Ŋåūį re-runïž æå
ģéŪįæŊ ä―č æŽå°į vitest æ°éäļååžæĒéåąäšå ķčŠčŋ°ïžæįįŧčŪšæēĄæäūčĩåŪäŧŽ ââ æéčŋé čŊŧįäš§äŧĢį äļæčĻïžéææ ļåŪäšäļĪäļŠč§čŊïžå æĪįŧčŪšäļæēĄæäŧŧä―éĻååŧšįŦåĻææ æģäšēčŠæ ļæĨįįŧæäđäļã ïžäļæđčĄĻæ žäļš CI æĢæĨéĄđäļįŧčŪšįæšåĻåŊčŊŧåšåïžæĪåĪäļåéåĪãïž įåŪåšæŊæĩčŊïžN/A ââ æēĄæįĻæ·åŊč§æđåĻïžįšŊæĩčŊïžįäš§äŧĢį 0 čĄïžïžäļåĻ CI č·ŊåūäļïžåŪæķčĄäļšäŋĄå·æĨčŠäļéĒį CI æĢæĨïžčäļæŊæŽå°éĐąåĻįäžčŊãäđæēĄæįįŧæēįŪąééåŧéŠčŊįčĄäļšæ§æčĻïžįŦŊåĢč§čŊæšäš spy čŪ°å―č°įĻåæ°įæšåķïžäļŧæšč§čŊæšäš mock č―ŽåčŊ·æąäļŧæšãčįäš§äŧĢį åĻ URL äļįĄŽįžį åįŊčŋäļįŧåïžåĨäŧķįįŧŋčēįķæåæĨčŠæĪåæåĻįéĢäļŠä―äļæŽčšŦã â Qwen Code · qwen3.8-max-2026-09-02 Reviewed at |
|
Confidence: 4/5 â clean across every stage and CI is fully green on the job that flaked; the single point keeping it from 5 is the disclosed coverage trade, which is inherent to the fix rather than a defect in it. Stepping back over the whole picture: the problem is a real The failure mode I went looking for is the one that matters on an autofix PR pointed at a flaky test: making CI green by weakening the assertion. That did not happen, and this head is stronger than the one I reviewed last round. At Nothing was deleted to get to green, and the diff carries no drive-by refactors. The one scope question â the sibling suite was edited too, and was not itself flaky â I've already answered in my favour: two copies of the same mock that behave differently is how the next person re-introduces this bug, and 2 lines to prevent that is cheap. It also followed from my own R1-1, so holding it against the author would be inconsistent. Would I curse or thank the author in six months? Thank them. The comment above the helper says why the port is deliberately not really bound and why forcing loopback would break the URL witness â that is precisely the note a future reader needs to avoid "fixing" this back into a flake. The residual is honest and stated in the PR: no test now proves a genuine 43190 bind succeeds in a container, and that proof was the flake. If we want it back, it belongs in an isolated lane with the port guaranteed free, not in the shared unit suite. Carrying that is the right trade. The non-blocking nit (the Verification posture, stated plainly so nobody has to guess what this run did and did not do: this is a CI-path re-run, so I executed nothing â no build, no test run, no PR checkout. The evidence is the PR's own 25 check-runs at Approval guardrail: not triggered. This is a same-repo branch ( Unlike last round, there is no CI left to wait for: zero workflow runs with äļæčŊīæäŋĄåŋïž4/5 ââ åéķæŪĩåæ éŪéĒïžäļåĻæĪåæåĻįéĢäļŠä―äļäļ CI å·ēå ĻįŧŋïžæēĄå° 5 åįåŊäļäļįđïžæŊæŽ PR äļŧåĻæŦéēįčĶįåčïžčéĢæŊæŽæŽĄäŋŪåĪåšæįäŧĢäŧ·ïžäļæŊæđåĻæŽčšŦįįžšé·ã éäļæĨįæīä―ïžéŪéĒæŊäļæŽĄæčŋčĄįžå·ãæä―äļåįįåŪ æįđæåŧæūįåĪąææĻĄåžïžæŊ autofix PR åŊđį flaky æĩčŊæķæčŊĨčĶæįéĢäļį§ïžé ååžąæčĻæ CI åįŧŋãčŋéæēĄæåįïžčäļå―å head æŊæäļäļč―ŪåŪĄæĨįéĢäļŠæīåžšãåĻ æēĄæäļšäšåįŧŋčå äļčĨŋïždiff äđæēĄæåĪđåļĶ饚æéæãåŊäļįčåīįéŪ ââ å åžåĨäŧķäđčĒŦæđäšïžčåŪæŽčšŦåđķäļæåĻ ââ æå·ēįŧįŧåšäšåŊđčŠå·ąæčŊīæåįįæĄïžåäļäļŠ mock įäļĪäŧ―åŊæŽčĨčĄäļšäļåïžæĢæŊäļäļäļŠäššéæ°åžå ĨčŋäļŠ bug įéåūïžįĻ 2 čĄéēæĒčŋį§äšïžææŽåūä―ãčäļčŋæŽĄæđåĻæščŠæčŠå·ąį R1-1ïžčĨäŧĨæĪččīĢä―č åđķäļäļčīã å äļŠæåæäžæč°Ēä―č čŋæŊåéŠä―č ïžæč°Ēãhelper äļæđéĢæŪĩæģĻéčŊīæäšįŦŊåĢäļšäŧäđæŊæ æäļįåŪįŧåŪįãäŧĨååžšåķåįŊäļšäŧäđäžį īå URL č§čŊ ââ čŋæĢæŊåæĨč æéčĶįäŋĄæŊïžč―éēæĒäŧäŧŽæåŪ"äŋŪ"åæåĻįķæãæŪįæŊčŊåŪįïžPR éäđåæäšïžį°åĻæēĄææĩčŊč―čŊæåŪđåĻå įåŪįŧåŪ 43190 äžæåïžčéĢäļŠčŊææŽčšŦå°ąæŊæåĻæĨæšãčĨæģčĄĨåæĨïžåšæūåĻč―äŋčŊįŦŊåĢįĐšéēįéįĶŧééäļïžčäļæŊå ąäšŦįåå æĩčŊåĨäŧķéãæŋæ čŋäļŠäŧĢäŧ·æŊæĢįĄŪįåčã éĢäļŠäļéŧåĄįå°įđïž éŠčŊå§ŋæčŊīææļ
æĨïžå
åūæäššéčĶįčŋæŽĄčŋčĄåäšäŧäđãæēĄåäŧäđïžčŋæŊ CI č·Ŋåūį re-runïžæäŧĨææēĄææ§čĄäŧŧä―äļčĨŋ ââ æēĄææåŧšãæēĄæč·æĩčŊãæēĄææĢåš PRãčŊæŪæŊæŽ PR čŠå·ąåĻ æđåæĪæ ïžæŠč§ĶåãčŋæŊåäŧåšåæŊïž äļäļäļč―ŪäļåïžčŋæŽĄæēĄæéčĶįåū
į CIïžčŊĨæäšĪäļæēĄæäŧŧä― â Qwen Code · qwen3.8-max-2026-09-02 Reviewed at |
ðĐš serve daemon A/BBuilt the PR base vs this PR head
|
| field | PR base (before) | this PR (after) |
|---|---|---|
activeWorkStaleMs |
6 |
5 |
â Qwen Code · serve A/B
yiliang114
left a comment
There was a problem hiding this comment.
Reviewed at head 6991d18 â LGTM.
The fix has the right shape for the #13775 flake: the spy keeps the requested (43190, '0.0.0.0') bind observable for the assertion while the real socket moves to an ephemeral loopback port, so a neighbor process holding 43190 on a shared CI host can no longer fail these tests.
Verified against the head source, not just the diff:
- The production worker calls
server.listen(port, host)with no callback and derives readiness fromserver.once('listening', âĶ)plusserver.address(), so the mock forwarding only[0, '127.0.0.1']cannot stall startup, andworker.ready.urlreflects the actually bound address â matching the new derived-URL assertion. - Both container-mode tests issue their follow-up requests against
worker.ready.url; no hard-coded 43190 remains anywhere in the file outside the call-argument assertion. - The existing
afterEachrunsvi.restoreAllMocks(), so the prototype spy cannot leak into sibling tests. - Same pattern the attestation-worker suite already established, so it stays consistent across the two files.
CI on this head shows no failures so far (a few lanes still running).
qwen-code-review-bot
left a comment
There was a problem hiding this comment.
Approving at head 6991d18. Test-only, one file, +19/â6; I confirmed no production source is touched, then checked the four things that decide whether a flake fix like this is real or just quiets the symptom.
The mechanism is the one in the logs, and the fix removes it rather than tolerating it. Both container-mode tests bound a hard-coded 43190 on 0.0.0.0, so any neighbor holding that port on the shared ecs-qwen host fails them with EADDRINUSE while everything else passes â matching the #13775 signature. mockEphemeralListen() (:85-91) keeps the requested arguments observable and moves the real bind to (0, '127.0.0.1'), so the suite is now indifferent to whether 43190 is occupied. Nothing was skipped, gated on port availability, or wrapped in a retry â which is what would have made this a silenced flake instead of a fixed one.
The sibling-pattern claim checks out. managed-runtime-attestation-worker.test.ts:625-639 already does exactly this: same const nativeListen = Server.prototype.listen, same Reflect.apply(nativeListen, this, [0, '127.0.0.1']), same expect(listen).toHaveBeenCalledWith(43190, '0.0.0.0'). This PR converges on an existing in-repo pattern rather than inventing one.
The spy does not leak. The first call site (:147) discards the return value, which is safe because this file has afterEach(async () => { vi.restoreAllMocks(); ... }) at :63-64. Worth noting the two suites restore differently â the sibling calls listen.mockRestore() inline at :660 â but both are correct, and restoreAllMocks covers the discarded handle.
The behavioral witness survives, with one trade the PR discloses. The old assertion inspected the actually bound socket (address() matching {address: '0.0.0.0', port: 43190}); the new one asserts the requested arguments. That is inherent to not binding the port, and the port-number witness is preserved â mutating the production bind port still fails toHaveBeenCalledWith(43190, '0.0.0.0'). Two things I specifically checked rather than assumed:
expect(worker.ready.url).toBe(\http://127.0.0.1:${address.port}\`)` (:329) still pins the host rewrite, because127.0.0.1is literal in the expectation while only the port is derived. Had both sides been derived, the "ready URL reports loopback, not the wildcard bind address" contract would have become unfalsifiable.- The tests still do real HTTP against the real socket â
fetch(worker.ready.url + route, ...)at:181and the attest POST at:330â so this is not a mock asserting its own return value. Only the port number is ephemeral.
The residual trade: neither container-mode test now witnesses a wildcard 0.0.0.0 bind actually succeeding. That coverage still exists in the sibling suite, which probes wildcard listeners separately at :279-288.
Not verified: I ran nothing locally â this box cannot hold the workspace (~1.2 GB free), so the EADDRINUSE-while-held reproduction and the 13/13 and 42/42 pass counts in the description are the author's, unreproduced by me. Test (ubuntu-latest, Node 22.x) and Lint & Static are green at this head; the Java lanes and web-shell E2E Smoke were still running, and cannot be affected by a CLI unit-test file.
Disclosure: this PR was authored by qwen-code-dev-bot and my review comes from qwen-code-review-bot â both accounts in the same automation family, so this approval is not an independent human check. Recording that as a fact rather than treating it as a blocker: the diff is test-only and I verified it line by line, but a maintainer's eyes remain the only independent review this PR will have had.
qwen-code-review-bot
left a comment
There was a problem hiding this comment.
Reviewed â no blockers. Suggestions are inline.
Test Plan (not a blocker): src/serve/managed-runtime-container.test.ts â no such file or directory; src/serve/managed-runtime-attestation-worker.test.ts â no such file or directory; 13 tests pass â this review observed 40057, 609 passed; 42 passed â this review observed 40057, 609 passed.
äļæčŊīæ
å·ēåŪĄæĨââæ éŧæéŪéĒã åŧščŪŪč§čĄå čŊčŪšã
Test Planïžééŧæïžïžsrc/serve/managed-runtime-container.test.ts â no such file or directory; src/serve/managed-runtime-attestation-worker.test.ts â no such file or directory; 13 tests pass â this review observed 40057, 609 passed; 42 passed â this review observed 40057, 609 passedã
â qwen3.8-max via Qwen Code /review (v0.25.0)
|
ð Review received â an automatic review of the current head is still running, so this round is held until it lands (a push now would cancel it and discard its work, #8888). Your feedback stays queued for the next eligible round. äļæčŊīæð å·ēæķå°čŊåŪĄ ââ å―å head äļäŧæäļč―ŪčŠåĻ review åĻčŋčĄïžæŽč―Ūæįžïžį°åĻæĻéäžåæķčŊĨ review åđķäļĒåžå ķå·Ĩä―ïž#8888ïžãåéĶäŋææéïžįåū äļäļæŽĄåŊčŋčĄįč―ŪæŽĄåĪįã |
|
â AutoFix round 2 finished â view run. See this round's report below. äļæčŊīæâ AutoFix įŽŽ 2 č―Ūå·ēåŪæ ââ æĨįčŋčĄãæŽč―ŪæĨåč§äļæđã |
âĶ13775) Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
410f707
|
ðĪ Addressed the latest review feedback (round 1/10). What changed, and what I pushed back on: · å·ēåĪįææ°čŊåŪĄåéĶïžįŽŽ 1/10 č―ŪïžãæđåĻå åŪđäļæåéĐģäŋįäđåĪåĶäļïž Round summaryAddressed the single inline suggestion from the round-1 review. One commit: Feedback dispositions
Reproduction and mutation probes
Other feedback
Verification
äļæčŊīææŽč―ŪæŧįŧåĪįäšįŽŽ 1 č―ŪčŊåŪĄäļåŊäļįäļæĄčĄå
åŧščŪŪãäš§įäļäļŠæäšĪïž åéĶåĪį―Ū
åĪį°äļååžæĒé
å ķäŧåéĶ
éŠčŊ
Base-conflict check · åšåæŊåēįŠæĢæĨ: no conflict with main. · äļ main æ åēįŠã ð§ĩ Resolved all 1 selected review thread(s). · å·ēå ģéå ĻéĻéäļį 1 æĄčŊåŪĄįšŋįĻã Re-review when you have a moment. After round 10 this bot stops and leaves the PR for a human. · æįĐščŊ·åĪåŪĄïžįŽŽ 10 č―ŪåæŽ bot åæĒåđķå° PR äšĪįŧäššå·Ĩã ð§ Handled by Qwen Code · model/æĻĄå |
|
ðĪ Reviewed the latest feedback â no changes needed. Why, point by point: · å·ēåŪĄé ææ°åéĶââæ éæđåĻãéįđčŊīæåå åĶäļïž No action this round â both failed checks are CI infrastructure flakes, not code defectsFeedback triaged
Diagnosis (from evidence, not guesswork)Both jobs failed in the
Corroborating evidence:
Why no code change
Verification
No files were changed and no commit was made this round. äļæčŊīææŽč―Ūæ éæđåĻââäļĪäļŠåĪąčīĨįæĢæĨåäļš CI åšįĄčŪūæ―åķåæ é,čéäŧĢį įžšé·å·ēåįąŧįåéĶ
čŊæ(åšäščŊæŪ,čéįæĩ)äļĪäļŠäŧŧåĄé―åĪąčīĨåĻ
ä―čŊ:
äļšäŧäđäļåäŧĢį æđåĻ
éŠčŊ
æŽč―ۿпđåĻäŧŧä―æäŧķ,äđæŠååŧšæäšĪã Base-conflict check · åšåæŊåēįŠæĢæĨ: no conflict with main. · äļ main æ åēįŠã ðĐļ Regression charged to round 1: that round pushed onto a head whose checks were all green and left them red. It no longer counts as progress for the consecutive-failure brake. · å·ēå°åå―čŪ°åĻįŽŽ 1 č―ŪïžčŊĨč―ŪåϿ̿Ĩå Ļįŧŋį head äļæĻéåæĢæĨč―ŽįšĒïžå æĪäļåčŪĄå ĨčŋįŧåĪąčīĨįæįæčŋåąåĪåŪã ð§ Handled by Qwen Code · model/æĻĄå |
|
ð Base updated: red check(s) [Runtime Broker and Managed Agent MariaDB / Java 21, Hosted process fault gates / MySQL 8.4 / Java 21] pass on current main â merged current main via update-branch; CI will re-run. äļæčŊīæð å·ēæīæ° baseïžįšĒčēæĢæĨ [Runtime Broker and Managed Agent MariaDB / Java 21, Hosted process fault gates / MySQL 8.4 / Java 21] åĻå―å main äļéčŋ ââ å·ēéčŋ update-branch åå Ĩå―å mainïžCI å°éæ°čŋčĄã |
|
@qwen-code /triage |
|
Sandboxed verification: â passed â merge-ready (agent verdict) - workflow run Ran the PR in an isolated, token-free container: A/B against the base build, mock-free harness assertions, targeted gates. Advisory evidence for human reviewers â not a review, an approval, or a CI check. Scripted assertions: 110 passed · 0 failed · 110 total Flakiness gate: â 2 changed test file(s) x 5 identical rounds, no divergence äļæ â åĪåŪïžâ éčŋ · åŊåå Ĩïžagent åĪåŪïžæēįŪąéŠčŊåĻéįĶŧãæ åčŊįåŪđåĻäļæ§čĄäščŊĨ PR įäŧĢį ïžäļ base æåŧš A/B åŊđį §ãæ mock harness æčĻãåŪåéĻįĶïžãäŧ ä―äļščŊåŪĄčŊæŪïžäļææčŊåŪĄãæđåæ CI æĢæĨã čæŽæčĻïž110 éčŋ · 0 åĪąčīĨ · 110 æŧčŪĄ æåĻéĻïžâ 2 changed test file(s) x 5 identical rounds, no divergence Verification reportVerdict: äļææčĶįŧčŪšïž A/B įŧčŪšïžäļåŋäļŧåž æįŦãäļæŊ load-bearing įïžïžåĻ CI åŪđåĻäļįĻäļäļŠæ å
ģčŋįĻå įĻ Findingsïžæ éŧåĄéĄđãäļĪæĄ Suggestion įš§č§åŊïžæčϿпč°įĻæŽĄåšéåŪïžcommit 2 į host éäž åĻå
åžåĨäŧķäļæ æĩčŊåŊč§æĩæķįïžåđķæčŊĨåĨäŧķåŪđåĻæĻĄåžįŧåŪįį―åĄäŧ ååžįĐéĩïž11 äļŠååžä―å
ĻéĻäļéĒæĩäļčīïžåŦ 1 äļŠæĢåŊđį
§ïžãå
ģéŪįŧæââįäš§įŦŊæ æŠčĶįčåīïž ScopeThe diff is test-only â 2 files, +24/â8, no production code:
Central claim: the two container-mode tests stop binding hard-coded Secondary claims: (1) the retained behavioural witness â mutating the production bind port still reddens the explicit-port test at Because the PR is test-only, the method is a mutation A/B across test files plus a port-collision A/B against a real base control, not a behaviour A/B against production. A/B cell matrix â the central claim is load-bearingControl: Internal-link confound checked, not assumed â from inside the base worktree every Comparator proven with a positive control: Port holder: an in-process Node
The 2 base reds are exactly the two container-mode tests ( B1 is a control worth reading: the sibling suite was already immune on base, because it already had the ephemeral-listen mock. That is the pattern this PR copies, and it confirms the mechanism rather than merely asserting it. Mutation matrix â does the suite still hold down what it claims to?Every mutant runs with port 43190 held, i.e. in the environment where head is known-green (A4/B2), so any red is attributable to the mutation. Runner hygiene: unmutated baseline green through the identical runner (42/42, exit 0); every anchor dry-run for exactly one occurrence; a
Kill attribution (named assertion, expected token present):
The combination row is the interesting oneM3 and M4 survived alone, which a one-row-per-guard matrix would file as two coverage gaps. They are not. M9 (production derives So the host forwarding in Upgraded from inferred to measured with a bind-host witness (
Both variants stay 42/42 green while instrumented, and the non-container workers in the same suites correctly bind Reading the M5 row correctlyM5 shows 6 reds, but only one is the intended witness. Hard-coding Reviewer Test Plan, step by step
Every step was performable; none was structurally unreachable. One deviation: the port holder was an in-process FindingsNo blocking findings. Two Suggestion-level observations, both measured and bounded. S1 â the port/host assertion is no longer scoped to the first
|
qwen-code-review-bot
left a comment
There was a problem hiding this comment.
LGTM, looks ready to ship. â
ð Local maintainer verification â verdict: merge-ready â14,102 assertions checked (tally in Methodology), 0 unexpected failures. ðĻðģ äļææčĶįŧčŪš:åŊäŧĨååđķã
What the PR changesTwo test files only, no production code ( A/B proof (port 43190 held by a throwaway
|
| Run | Result | Signature |
|---|---|---|
Base test files (merge-base c0c697c8a3), port held |
â 2 failed / 11 passed | listen EADDRINUSE: address already in use 0.0.0.0:43190 â byte-identical to the CI failure in run 37925143593 (confirmed in that run's logs), failing tests exactly the two named in #13775 |
| PR head, port held | â 13/13 passed | flake mechanism removed |
| PR head, port free | â 13/13; pair with attestation-worker suite 42/42 | no regression on the normal path |
The A/B used one built worktree at the PR head with only the two test files swapped to their base versions in place; git status verified clean after each swap/restore.
Mutation witness (the modified test still has teeth)
Mutating the production bind in managed-runtime-attestation-worker.ts (containerMode ? 43190 : 0 â 43199) is killed by opens the explicit container port with authenticated attestation failing at expect(listen).toHaveBeenCalledWith(43190, '0.0.0.0') (line 330) â 1 mutant, 1 kill. The requested-port guard survives the move from "assert the real bind" to "spy the request".
Gates
| Gate | Result |
|---|---|
npm run build (worktree) |
â all packages |
npm run typecheck |
â 0 errors |
| eslint on the 2 changed files | â
clean; gate liveness proven first (planted debugger; fired no-debugger) |
Collateral sweep: all of packages/cli/src/serve/ (310 files) |
13,599 passed / 3 failed in 3 files untouched by this PR â hosted-harness-session (409-vs-204), hosted-hook-session (15 s test timeout), orchestrator (ENOTEMPTY tmpdir race). None bind fixed ports; all 3 pass on an isolated re-run (443/443), i.e. load/parallelism flakes unrelated to this change |
Code review notes
- The helper mirrors the sibling attestation-worker suite's established pattern (the PR description's claim checks out in the diff).
- Production container-mode bind (
containerMode ? 43190 : 0, containerMode ? '0.0.0.0' : '127.0.0.1',managed-runtime-attestation-worker.ts:292-295) is unchanged â only the tests stop really binding the fixed port. - The new
ready.urlassertion derives the expected port from the actually bound address while production hard-codes the127.0.0.1host (managed-runtime-attestation-worker.ts:313); the attest round-trip in the test still exercises the real listener over the ephemeral port. The helper's comment correctly explains why only the port is overridden (forcing loopback would weaken the host dimension). [0, ...args.slice(1)]faithfully forwards host/backlog/callback arguments in both suites.
Not covered
- Windows (CI skipped
Test (windows-latest, Node 22.x)on this PR; not run locally). macOS is covered by this report; the author's own matrix had macOS untested and CI skippedTest (macos-latest, Node 22.x)as well, so this run fills that gap. - The real production 43190 bind in container startup â unchanged and intentionally untested here.
- Other suites' fixed-port usage â not audited (out of scope, as the PR states).
Methodology
Worktree at 39d9dd574a (installed with the shared pnpm store, built, workspace symlink verified to resolve inside the tree â no cross-tree leak). A/B by in-place swap of the two test files to their merge-base versions and back, with the port collision produced by node -e "require('node:net').createServer().listen(43190, '0.0.0.0', ...)" held throughout. CI signature cross-checked against run 37925143593 logs. Assertion tally: 14,097 unit-gate passes (42 focused + 13 head-under-contention + 13,599 collateral + 443 isolation re-run) + 4 harness assertions (2 predicted red signatures, 1 CI signature match, 1 lint-liveness plant) + 1 mutation kill = 14,102.
Evidence captures
A-side: base test files, port held â 2 failed with EADDRINUSE 0.0.0.0:43190 (CI signature), holder visible in lsof:

B-side: PR head, same port still held â 13/13 passed:

Mutation: production 43190 â 43199 killed by the spy assertion, then restored:

Full terminal flow of all three arms:

Local verification performed and posted by @wenshao's maintainer tooling; artifacts (logs, assertions.json, verdict.txt) retained locally under tmp/pr13778-verify-20261010-092223/.
yiliang114
left a comment
There was a problem hiding this comment.
Re-reviewed at head 39d9dd5 after the branch picked up main. The only new in-PR commit is 410f707: the ephemeral-listen mock now overrides only the port and forwards the requested host, so the ready.url host assertion is no longer self-referential while the EADDRINUSE fix is preserved. No blocking findings.
|
ðĪ Reviewed the latest feedback â no changes needed. Why, point by point: · å·ēåŪĄé ææ°åéĶââæ éæđåĻãéįđčŊīæåå åĶäļïž Autofix round: no action requiredNo actionable feedback arrived since the last evaluation (2026-10-09T21:33:47Z), so this round made no code changes. What the feedback contained
DispositionWith no Required findings, no Optional suggestions, no failed checks, and no conflict to resolve, there was nothing to implement, decline, defer, or escalate. The PR remains as verified: a test-only change (+24/â8 across VerificationNo code changed this round, so no verification commands were run. Existing state relied upon:
äļæčŊīæAutofix æŽč―Ū:æ éåĪįčŠäļæŽĄčŊäž°(2026-10-09T21:33:47Z)äŧĨæĨæēĄææķå°åŊæä―įåéĶ,å æĪæŽč―ŪæŠåäŧŧä―äŧĢį æđåĻã åéĶå åŪđ
åĪįįŧčŪšæēĄæ Required åį°ãæēĄæ Optional åŧščŪŪãæēĄæåĪąčīĨįæĢæĨãäđæēĄæéčĶč§ĢåģįåēįŠ,å æĪæŽč―ŪæēĄæäŧŧä―éčĶåŪį°ãæįŧãåŧķåæåįš§įäšéĄđãPR įŧīæå·ēéŠčŊįįķæ:äļäļŠįšŊæĩčŊæđåĻ(č·Ļ éŠčŊæŽč―ŪæēĄæäŧĢį æđåĻ,å æĪæŠčŋčĄäŧŧä―éŠčŊå―äŧĪãæäūæŪįį°æįķæ:
Base-conflict check · åšåæŊåēįŠæĢæĨ: no conflict with main. · äļ main æ åēįŠã ð§ Handled by Qwen Code · model/æĻĄå |
Resolve the managed-runtime-container.test.ts overlap with QwenLM#13778 (merged): both PRs add an ephemeral-listen mock for the same port conflict. Keep main's mockEphemeralListen (host-forwarding shape) and drop this PR's duplicate listenOnEphemeralPort; the remaining delta is the boot3 test now also asserting the requested (43190, '0.0.0.0') bind arguments. Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
|
Released in v0.25.1. |



What this PR does
Makes the two container-mode tests in the Managed Runtime container-entry suite stop binding the hard-coded container port 43190 for real. A new test-local helper spies on the HTTP server's
listen, keeps the requested(43190, '0.0.0.0')arguments observable for assertions, but performs the actual bind on an ephemeral loopback port(0, '127.0.0.1')â the same pattern the sibling attestation-worker suite already uses for its own container-mode test. The explicit-port test still asserts the worker was asked to listen on(43190, '0.0.0.0'), and now derives the expected ready URL from the actually bound address instead of a hard-coded port. No production code changes.Why it's needed
A main-branch CI run failed on exactly these two tests (issue #13775, run 37925143593 at
8c127de524a6). Both tests bind fixed port 43190 on0.0.0.0; theTest (ubuntu-latest, Node 22.x)job can run on the shared self-hostedecs-qwenfleet where several jobs share one host, so any neighbor holding 43190 fails both tests withEADDRINUSEwhile everything else passes. Locally holding the port with a throwaway process reproduces the identical failure signature (2 failed / 11 passed,listen EADDRINUSE: address already in use 0.0.0.0:43190); with this change the suite passes whether or not 43190 is occupied.Reviewer Test Plan
How to verify
Confirm the flake mechanism and its removal: in one shell, hold the port with
node -e "require('node:net').createServer().listen(43190, '0.0.0.0', () => setInterval(() => {}, 1000))"; in another, runcd packages/cli && npx vitest run src/serve/managed-runtime-container.test.ts. Before this change the two container-mode tests fail withEADDRINUSE; after it, all 13 tests pass. Also run the file normally (port free) â all 13 tests pass â andnpx vitest run src/serve/managed-runtime-container.test.ts src/serve/managed-runtime-attestation-worker.test.tsfor the pair of container-mode suites (42 passed). The retained behavioral witness: mutating the source bind port from 43190 to anything else makesopens the explicit container port with authenticated attestationfail at thetoHaveBeenCalledWith(43190, '0.0.0.0')assertion.Evidence (Before & After)
N/A â test-only change, no user-visible behavior.
Tested on
Environment (optional)
N/A â unit tests only (
npx vitest runinpackages/cli).Risk & Scope
listenspy, matching the sibling suite's established pattern.Linked Issues
Fixes #13775
äļæčŊīæ
čŋäļŠ PR åäšäŧäđ
čŪĐ Managed Runtime åŪđåĻå ĨåĢæĩčŊåĨäŧķäļįäļĪäļŠåŪđåĻæĻĄåžæĩčŊäļåįåŪįŧåŪįĄŽįžį įåŪđåĻįŦŊåĢ 43190ãæ°åĒįæĩčŊå čū åĐå―æ° spy HTTP æåĄåĻį
listen,äŋįåŊæčĻįčŊ·æąåæ°(43190, '0.0.0.0'),ä―įåŪįŧåŪæđäļšäļīæķåįŊįŦŊåĢ(0, '127.0.0.1')ââäļå åž attestation-worker æĩčŊåĨäŧķäļšå ķåŪđåĻæĻĄåžæĩčŊéįĻįæĻĄåžäļčīãæūåžįŦŊåĢæĩčŊäŧįķæčĻ worker čĒŦčĶæąįåŽ(43190, '0.0.0.0'),åđķæđäļšäŧåŪé įŧåŪįå°åæĻåŊžææį ready URL,čäļåįĄŽįžį įŦŊåĢãäļæđåĻäŧŧä―įäš§äŧĢį ãäļšäŧäđéčĶ
äļŧåæŊįäļæŽĄ CI čŋčĄæ°åĨ―åĻčŋäļĪäļŠæĩčŊäļåĪąčīĨ(issue #13775,čŋčĄ 37925143593,æäšĪ
8c127de524a6)ãäļĪäļŠæĩčŊé―åĻ0.0.0.0äļįŧåŪåšåŪįŦŊåĢ 43190;Test (ubuntu-latest, Node 22.x)ä―äļåŊč―čŋčĄåĻå ąäšŦįčŠæįŪĄecs-qwenæšįūĪäļ,åĪäļŠä―äļå ąäšŦåäļå°äļŧæš,å æĪäŧŧä―å įĻ 43190 įéŧåą é―äžčŪĐčŋäļĪäļŠæĩčŊäŧĨEADDRINUSEåĪąčīĨ,čå ķä―æĩčŊå ĻéĻéčŋãæŽå°įĻäļäļŠäļīæķčŋįĻå įĻčŊĨįŦŊåĢåģåŊåĪį°åŪå ĻįļåįåĪąčīĨįđåū(2 åĪąčīĨ / 11 éčŋ,listen EADDRINUSE: address already in use 0.0.0.0:43190);åšįϿ޿đåĻå,æ čŪš 43190 æŊåĶčĒŦå įĻ,åĨäŧķé―č―éčŋãčŊåŪĄéŠčŊčŪĄå
åĶä―éŠčŊ
įĄŪčŪĪæåĻæšåķåå ķæķéĪ:åĻäļäļŠįŧįŦŊäļįĻ
node -e "require('node:net').createServer().listen(43190, '0.0.0.0', () => setInterval(() => {}, 1000))"å įĻįŦŊåĢ;åĻåĶäļäļŠįŧįŦŊäļčŋčĄcd packages/cli && npx vitest run src/serve/managed-runtime-container.test.tsãæđåĻå,äļĪäļŠåŪđåĻæĻĄåžæĩčŊäŧĨEADDRINUSEåĪąčīĨ;æđåĻå,13 äļŠæĩčŊå ĻéĻéčŋãåæķåĻįŦŊåĢįĐšéēæķæĢåļļčŋčĄčŊĨæäŧķââ13 äļŠæĩčŊå ĻéĻéčŋââåđķįĻnpx vitest run src/serve/managed-runtime-container.test.ts src/serve/managed-runtime-attestation-worker.test.tsčŋčĄäļĪäļŠåŪđåĻæĻĄåžåĨäŧķ(42 äļŠéčŋ)ãäŋįįčĄäļšč§čŊ:å°æšį äļįįŧåŪįŦŊåĢäŧ 43190 æđæäŧŧä―å ķäŧåž,äžä―ŋopens the explicit container port with authenticated attestationåĻtoHaveBeenCalledWith(43190, '0.0.0.0')æčĻåĪåĪąčīĨãåååŊđæŊčŊæŪ
N/A ââ äŧ æĩčŊæđåĻ,æ įĻæ·åŊč§čĄäļšã
æĩčŊåđģå°
įŊåĒ(åŊé)
N/A ââ äŧ åå æĩčŊ(åĻ
packages/cliäļnpx vitest run)ãéĢéĐäļčåī
listenspy æčĻ,äļå åžåĨäŧķįæĒææĻĄåžäļčīãå ģč Issue
Fixes #13775