You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maka.apache.org by "orangeCatDeveloper (via GitHub)" <gi...@apache.org> on 2026/09/18 07:01:34 UTC

[PR] test(desktop): deflake Command Code browser login port release [maka]

orangeCatDeveloper opened a new pull request, #5479:
URL: https://github.com/apache/maka/pull/5479

   ## Summary
   
   `CommandCodeBrowserLoginController` tests intermittently flaked on `an occupied port is skipped for the next one in the CLI range` with `46961 !== 46960`. Two defects caused the port collision:
   1. `isPortFree` called `occupyPort`, unintentionally retaining an active `net.Server` in `netServers` until `afterEach`.
   2. Tests completing or settling attempts (notably `two simultaneous starts`) did not await the winner's loopback port release before ending, racing the subsequent test against OS socket teardown.
   
   Refs #5395
   
   ## Verification
   
   Before: `isPortFree` leaked probe servers into `netServers`, and unawaited asynchronous socket teardown after simultaneous starts caused EADDRINUSE races in subsequent port allocation (failing CI run 35314799012).
   After: 50/50 consecutive runs passed (`dist/main/__tests__/commandcode-browser-login.test.js`).
   
   Evidence:
   ```
   ✔ CommandCodeBrowserLoginController (324.882208ms)
   ℹ tests 20
   ℹ suites 2
   ℹ pass 20
   ℹ fail 0
   50/50 passed
   ```
   
   Checks run:
   - `npm run format:check` (biome passed)
   - `npm run lint` (biome passed)
   - `npm run typecheck` in `apps/desktop` (passed)
   - `npm run check:tui-copy` (ok)
   - `node scripts/check-renderer-architecture.mjs --base origin/main` in `apps/desktop` (passed)
   - `npm run build:main` and `node --test "dist/main/__tests__/commandcode-browser-login.test.js"` in `apps/desktop` (20/20 passed)
   
   ## AI use
   
   Select exactly one:
   
   - [ ] No generative tool made a substantive contribution
   - [x] Generative tooling made a substantive contribution
   
   Tool(s) and scope: GitHub Copilot diagnosed the port race, updated probe behavior and teardown assertions, and verified test suites. Commit includes the `Generated-by: GitHub Copilot` trailer.
   
   ## Checklist
   
   - [x] Tests cover the change and fail without it
   - [x] Lint, format, typecheck and the affected suites pass locally
   
   Does this PR entail a change in behavior?
   
   - [ ] Yes — described under Summary above
   - [x] No


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [PR] test(desktop): deflake Command Code browser login port release [maka]

Posted by "orangeCatDeveloper (via GitHub)" <gi...@apache.org>.
orangeCatDeveloper commented on PR #5479:
URL: https://github.com/apache/maka/pull/5479#issuecomment-5726479197

   @Astro-Han 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [PR] test(desktop): deflake Command Code browser login port release [maka]

Posted by "orangeCatDeveloper (via GitHub)" <gi...@apache.org>.
orangeCatDeveloper closed pull request #5479: test(desktop): deflake Command Code browser login port release
URL: https://github.com/apache/maka/pull/5479


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org