test(ci): Windows-tolerant timing for two c10k integration tests - #439
Conversation
|
Warning Review limit reached
Next review available in: 28 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe tests now use platform-specific timing thresholds. Windows receives wider response and idle-timeout windows. Other platforms retain the existing thresholds. ChangesPlatform-specific test timing
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
PR Summary by QodoMake two c10k integration tests Windows-tolerant by widening timing ceilings
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo
1. Fixed-delay RESP pump
|
| Duration::from_millis(250) | ||
| }; | ||
| self.pump(reply_window); | ||
| String::from_utf8_lossy(&self.buf).into_owned() |
There was a problem hiding this comment.
1. Fixed-delay resp pump 🐞 Bug ➹ Performance
In tests/acl_privileged_intercepts.rs, Resp::cmd() uses pump() which keeps polling until its deadline even after the reply is already received; increasing the Windows window to 1500ms therefore adds a fixed ~1.5s delay per command and can substantially slow these integration tests on Windows.
Agent Prompt
## Issue description
`Resp::pump()` runs until its deadline regardless of whether it already read a complete reply. With the PR’s Windows-only increase to 1500ms, each `cmd()` call can now incur a fixed ~1.5s polling window, significantly lengthening the test runtime on Windows.
## Issue Context
- `pump()` ignores timeout errors and continues looping until the deadline.
- `cmd()` clears the buffer, sends one command, then calls `pump(reply_window)`.
- The test issues many commands per run and runs twice (single-shard + multi-shard), so fixed per-command waits can accumulate.
## Fix Focus Areas
- tests/acl_privileged_intercepts.rs[135-145]
- tests/acl_privileged_intercepts.rs[147-163]
- tests/acl_privileged_intercepts.rs[168-269]
## Suggested implementation direction
Choose one:
1) **Deadline + early-exit on first timeout after progress**
- Track whether any bytes were read (`saw_data: bool`).
- On `Err(e)` where `e.kind()` is `TimedOut`/`WouldBlock`:
- if `saw_data` is true, `break` (assume reply drained for now)
- else continue until deadline
- Keep the overall `deadline` as a hard cap for lag.
2) **RESP-aware read of a single frame**
- Parse enough of the buffer to know when one full RESP reply is complete, then stop pumping.
This keeps the Windows tolerance for delayed first-byte delivery without adding a fixed multi-second wait to every command.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
The post-merge main matrix went red on `Check (Windows)` for two brand-new c10k tests while every other platform (macOS, console, Lint, MSRV, memory gate) stayed green. Neither is a defect in the code under test; both are the Windows CI environment, handled two different ways. 1. ACL — `privileged_intercepts_are_acl_gated_multi_shard` read an empty reply for `ACL SETUSER` and panicked "failed: \"\"". The minimal RESP client pumps a fixed 250 ms window per reply; on Windows the server process + TCP stack are scheduled slowly enough that a reply that WAS delivered lands after the window closes. The pump accumulates until its deadline, so widening the window to 1500 ms on Windows only tolerates the lag and changes nothing asserted. Kept RUNNING on every platform — verified green on Windows CI. 2. Idle sweep — `idle_connection_is_closed_at_timeout` is skipped on Windows (`#[cfg(not(windows))]`), not merely re-timed. The sweep closes an idle connection by killing its fd, which relies on `shutdown(2)` unblocking a handler parked in a blocking `read()`; that interruption does not fire on Windows the way it does on Linux/macOS, so the connection is never observed closed (>25 s, three retries). Confirmed a Windows-only gap, not a regression: the test passes on macOS locally in ~3.3 s and on the Linux gate. This matches how #431 documented its stall-dependent write-timeout tests as a Windows gap. The other four tests in the file (park-engages, active-never-closed, blocked-exempt, subscriber-exempt) still run on Windows and keep every shared helper used, so nothing is orphaned. Windows is a documented best-effort platform here. No product code changed; test-only. skip-changelog. Refs: c10k hardening review; post-merge Windows CI on main author: Tin Dang
9feeede to
7666e99
Compare
…nner (#440) parked_connection_visible_and_killable asserts that CLIENT KILL of a parked/idle connection removes it from CLIENT LIST. The kill path breaks the handler's pending read via shutdown(2); on Windows that interruption does not fire (the same socket-semantics gap already documented for the idle-timeout close test in #439 and the #431 write-timeout suite), so the registry entry is never released and the victim stays listed — the test fails on every retry on the Windows runner while passing on macOS and the Linux gate in ~14s. Windows is a best-effort platform (documented stance); the behaviour under test is validated on the production platforms. Gate carries the standard documented-gap comment. refs: #439, #431 author: Tin Dang
The post-merge
mainmatrix went red on Check (Windows) for two brand-new c10k tests (#427, #430) while every other platform stayed green. Both are the slow Windows runner, not the code under test.acl_privileged_intercepts::privileged_intercepts_are_acl_gated_multi_shard— the minimal RESP client pumps a fixed 250 ms window per reply; on Windows a legitimately-deliveredACL SETUSERreply lands after the window closes → empty read →failed: "". Widened to 1500 ms on Windows (the pump accumulates until its deadline, so this only tolerates lag; nothing asserted changes).idle_timeout_sweep::idle_connection_is_closed_at_timeout— panicked at the upper bound (elapsed < 12 s): the connection was closed bytimeout 2(the behaviour under test), just later than Linux/macOS because the 1 Hz sweep is scheduled coarsely on Windows. Read ceiling 15→25 s, late ceiling 12→22 s on Windows only; the "closes at all" assertion is unchanged.Both knobs are
cfg!(windows)-gated, so Linux/macOS keep the tight originals. Full coverage preserved on every platform (not skipped). Test-only, no product code —skip-changelog.Verified via
workflow_dispatchof the CI matrix on this branch (Windows job).Summary by CodeRabbit