Skip to content

fix(server): cfg-gate accept-backoff TEST libc errnos for Windows#243

Merged
pilotspacex-byte merged 1 commit into
mainfrom
fix/win-accept-backoff-tests
Jul 7, 2026
Merged

fix(server): cfg-gate accept-backoff TEST libc errnos for Windows#243
pilotspacex-byte merged 1 commit into
mainfrom
fix/win-accept-backoff-tests

Conversation

@pilotspacex-byte

@pilotspacex-byte pilotspacex-byte commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #242's Windows fix: the resource_exhaustion_classification unit test in accept_backoff.rs also references libc:: errnos, so the main-push Windows check still fails E0433 on the test build (the Windows job is skipped on PRs — neither the original break from #230 nor the partial fix could be caught pre-merge). The test is now cfg-split the same way as the function under test: unix keeps the libc errnos, Windows uses WSAEMFILE (10024) / WSAENOBUFS (10055) / WSAECONNABORTED (10053).

Verified: cargo test --lib server::accept_backoff 4/4, fmt clean, and grep confirms every libc:: site in the file is now behind #[cfg(unix)].

Summary by CodeRabbit

  • Bug Fixes
    • Improved cross-platform handling for a server error classification test, ensuring it now works correctly on both Unix and Windows systems.
    • Corrected platform-specific error handling so resource exhaustion and connection reset cases are validated with the appropriate error codes on each OS.
  • Documentation
    • Updated the changelog to reflect the broader Windows build fix coverage.

Follow-up to the accept_backoff Windows fix in PR #242: the module's
resource_exhaustion_classification unit test also referenced
libc::EMFILE/ENFILE/ECONNABORTED, so the main-push Windows check kept
failing E0433 on the test build. cfg-split the test the same way as
the function under test: unix keeps the libc errnos, Windows uses
WSAEMFILE (10024) / WSAENOBUFS (10055) / WSAECONNABORTED (10053).

The Windows job runs only on main pushes (skipped on PRs), which is
why neither the original break (PR #230) nor the partial fix could be
validated pre-merge.

author: Tin Dang
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8a7afa9f-5217-4c5b-a9e5-c982fb6e65c2

📥 Commits

Reviewing files that changed from the base of the PR and between 6e2ae82 and 4f91cbd.

📒 Files selected for processing (2)
  • CHANGELOG.md
  • src/server/accept_backoff.rs

📝 Walkthrough

Walkthrough

The resource_exhaustion_classification unit test in accept_backoff.rs is updated to construct platform-specific error codes using cfg(unix) versus cfg(not(unix)) branches instead of unconditional libc constants. The CHANGELOG.md entry is updated to describe this test fix.

Changes

Test cfg-splitting fix

Layer / File(s) Summary
Platform-specific error construction in test
src/server/accept_backoff.rs, CHANGELOG.md
The test now conditionally builds EMFILE/ENFILE and ECONNABORTED errors using libc on Unix and numeric WSA codes on non-Unix; changelog note extended to mention this test update.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Related Issues: None specified

Related PRs: None specified

Suggested labels: windows, tests, changelog

Suggested reviewers: None specified

🐰 A rabbit hopped across the platform divide,
Errno on one side, WSA on the other side,
Tests now cfg-split with care,
Windows builds no longer despair,
Changelog notes the fix with pride.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: cfg-gating the accept_backoff test’s libc errno usage for Windows.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/win-accept-backoff-tests

Warning

Tools execution failed with the following error:

Failed to run tools: 13 INTERNAL: Received RST_STREAM with code 2 (Internal server error)


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pilotspacex-byte pilotspacex-byte merged commit 26967ea into main Jul 7, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants