Skip to content

fix(dev): cancel readiness retries on abort - #2109

Merged
jariy17 merged 4 commits into
aws:refactorfrom
Hweinstock:fix/windows-test
Aug 26, 2026
Merged

fix(dev): cancel readiness retries on abort#2109
jariy17 merged 4 commits into
aws:refactorfrom
Hweinstock:fix/windows-test

Conversation

@Hweinstock

@Hweinstock Hweinstock commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Problem

waitForPort left active sockets and scheduled retries alive after abort. In CI, the supervisor's 60ms abort test instead ran for about 60 seconds and timed out; the original #2041 Windows run eventually lost its runner.

Solution

Abort now destroys the active socket, clears the pending retry, removes its listener, and rejects immediately. The TCP test also closes accepted sockets and awaits listener shutdown.

Testing

  • Windows unit CI passed in 3m24s.
  • Supervisor suite passed 25 consecutive runs; the abort test completes in about 60ms.
  • Supervisor, project dev, and port tests passed: 31/31.
  • Prettier and tsc --noEmit passed.

@github-actions github-actions Bot added the size/xs PR size: XS label Aug 26, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added agentcore-harness-reviewing AgentCore Harness review in progress claude-security-reviewing Claude Code /security-review in progress labels Aug 26, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Aug 26, 2026

@agentcore-devx-automation agentcore-devx-automation Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

AgentCore Harness Review

Verdict: Looks good

Small, well-scoped test-only fix. The change correctly addresses both sides of the lingering handle problem:

  1. createServer((socket) => socket.destroy())waitForPort opens a real TCP connection (src/io/port.ts:60) that the server accepts. Previously nothing destroyed the server-side accepted socket, so its handle could keep Bun's event loop alive on Windows.
  2. Awaiting server.close() via its callback ensures the listener is fully released before the test returns, rather than relying on the previous fire-and-forget call.

The PR description accurately explains the Windows CI hang, the fix matches the described root cause, and no production code is touched. Nothing to change here.

@agentcore-devx-automation agentcore-devx-automation Bot removed the agentcore-harness-reviewing AgentCore Harness review in progress label Aug 26, 2026
@codecov-commenter

codecov-commenter commented Aug 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.71429% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.41%. Comparing base (f1a651c) to head (5ae5799).

Files with missing lines Patch % Lines
src/io/port.ts 85.71% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           refactor    #2109      +/-   ##
============================================
- Coverage     97.42%   97.41%   -0.02%     
============================================
  Files           429      429              
  Lines         26314    26330      +16     
============================================
+ Hits          25637    25649      +12     
- Misses          677      681       +4     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions Bot added size/xs PR size: XS and removed size/xs PR size: XS labels Aug 26, 2026
@Hweinstock Hweinstock changed the title fix(test): await readiness server shutdown fix(dev): abort readiness socket attempts Aug 26, 2026
@github-actions github-actions Bot added size/xs PR size: XS and removed size/xs PR size: XS labels Aug 26, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Aug 26, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Aug 26, 2026
@Hweinstock Hweinstock changed the title fix(dev): abort readiness socket attempts fix(dev): cancel active readiness sockets Aug 26, 2026
@github-actions github-actions Bot added size/xs PR size: XS and removed size/xs PR size: XS labels Aug 26, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Aug 26, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Aug 26, 2026
@Hweinstock Hweinstock changed the title fix(dev): cancel active readiness sockets fix(dev): cancel readiness retries on abort Aug 26, 2026
@github-actions github-actions Bot added size/s PR size: S and removed size/xs PR size: XS size/s PR size: S labels Aug 26, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Aug 26, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Aug 26, 2026
@Hweinstock

Copy link
Copy Markdown
Contributor Author

Related: #2110

@github-actions github-actions Bot added size/s PR size: S and removed size/s PR size: S labels Aug 26, 2026
@Hweinstock
Hweinstock marked this pull request as ready for review August 26, 2026 12:58

@tejaskash tejaskash left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the fix!

@jariy17
jariy17 merged commit 097e1f0 into aws:refactor Aug 26, 2026
27 of 30 checks passed
@Hweinstock
Hweinstock deleted the fix/windows-test branch August 26, 2026 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/s PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants