Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughThree benchmark harnesses updated to support concurrent request validation, eliminate temporary config file generation in websocket tests, and improve runtime lifecycle management with better error reporting. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
engine/benches/http_blackbox/mod.rs (1)
211-218: Avoid silently accepting action-based invokes in this benchmark worker.Using
action: _makesSome(...)follow the same echo path as baseline invokes, which can hide action-routing regressions. Prefer matchingaction: Noneand handlingSome(...)separately.♻️ Proposed change
Message::InvokeFunction { invocation_id, function_id, data, traceparent, baggage, - action: _, + action: None, } => { let invocation_id = invocation_id.unwrap_or_else(Uuid::new_v4); let response = Message::InvocationResult { invocation_id, function_id, @@ let _ = outbound_tx.send(WsMessage::Text( serde_json::to_string(&response) .expect("serialize InvocationResult") .into(), )); } + Message::InvokeFunction { action: Some(_), .. } => {} _ => {}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@engine/benches/http_blackbox/mod.rs` around lines 211 - 218, The current match arm for Message::InvokeFunction uses action: _ which treats action-bearing invokes the same as baseline echoes; update the pattern to match action: None in the Message::InvokeFunction arm (preserving invocation_id, function_id, data, traceparent, baggage) and add a separate match arm for Message::InvokeFunction { invocation_id, function_id, data, traceparent, baggage, action: Some(action) } that explicitly handles or logs/errors on action-based invokes (e.g., return an error or panic/log a warning) so action routing regressions aren't silently accepted; adjust any downstream uses of invocation_id/function_id accordingly.engine/benches/ws_roundtrip_bench.rs (1)
220-227: Prefer strictactionhandling in the service worker match.
action: _will echo action-based invokes the same as baseline invokes. Matchingaction: Noneexplicitly makes this benchmark less likely to mask action-routing regressions.♻️ Proposed change
Message::InvokeFunction { invocation_id, function_id, data, traceparent, baggage, - action: _, + action: None, } => { let invocation_id = invocation_id.unwrap_or_else(Uuid::new_v4); let response = Message::InvocationResult { invocation_id, function_id, @@ .await .expect("send InvocationResult"); } + Message::InvokeFunction { action: Some(_), .. } => {} _ => {}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@engine/benches/ws_roundtrip_bench.rs` around lines 220 - 227, The pattern matching arm for Message::InvokeFunction currently uses a wildcard for the action field (action: _), which conflates action-based invokes with baseline invokes; update the match to explicitly require action: None in that arm (i.e., Message::InvokeFunction { invocation_id, function_id, data, traceparent, baggage, action: None, } ) and add a separate arm (or an explicit match case) to handle Some(action) if needed so action-based invokes are not treated as baseline in ws_roundtrip_bench.rs.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@engine/benches/http_blackbox/mod.rs`:
- Around line 211-218: The current match arm for Message::InvokeFunction uses
action: _ which treats action-bearing invokes the same as baseline echoes;
update the pattern to match action: None in the Message::InvokeFunction arm
(preserving invocation_id, function_id, data, traceparent, baggage) and add a
separate match arm for Message::InvokeFunction { invocation_id, function_id,
data, traceparent, baggage, action: Some(action) } that explicitly handles or
logs/errors on action-based invokes (e.g., return an error or panic/log a
warning) so action routing regressions aren't silently accepted; adjust any
downstream uses of invocation_id/function_id accordingly.
In `@engine/benches/ws_roundtrip_bench.rs`:
- Around line 220-227: The pattern matching arm for Message::InvokeFunction
currently uses a wildcard for the action field (action: _), which conflates
action-based invokes with baseline invokes; update the match to explicitly
require action: None in that arm (i.e., Message::InvokeFunction { invocation_id,
function_id, data, traceparent, baggage, action: None, } ) and add a separate
arm (or an explicit match case) to handle Some(action) if needed so action-based
invokes are not treated as baseline in ws_roundtrip_bench.rs.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 310c7af1-1204-41de-a950-84765e0dfeab
📒 Files selected for processing (3)
engine/benches/http_blackbox/mod.rsengine/benches/protocol_serde_bench.rsengine/benches/ws_roundtrip_bench.rs
8231f11 to
a01f805
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
engine/benches/ws_roundtrip_bench.rs (1)
55-57:⚠️ Potential issue | 🟠 MajorSurface engine startup failures instead of swallowing them.
At Line 56,
let _ = builder.serve().await;drops the actual startup error. If serve fails, startup then degrades into timeout/panic paths (Lines 59-65) without the real cause, which makes CI bench failures hard to diagnose and undermines the retry intent.Also applies to: 59-65
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@engine/benches/ws_roundtrip_bench.rs` around lines 55 - 57, The spawn currently swallows errors by doing `let _ = builder.serve().await;` inside the `tokio::spawn` task (the `engine_task`), losing the real startup failure; change the task to surface the `serve()` result instead of discarding it — e.g., have the async move return the Result from `builder.serve().await` (or call `.expect()`/`.unwrap()` with a clear message) and then check the JoinHandle (`engine_task.await`) so any error from `builder.serve()` is propagated/logged to the test harness; apply the same fix to the other similar block(s) around lines 59-65 so no startup errors are swallowed.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@engine/benches/http_blackbox/mod.rs`:
- Around line 94-101: The readiness check allows concurrent_requests == 0 which
creates an empty probe batch and incorrectly treats the route as ready; in
wait_for_stable_route (and any other callers that pass concurrent_requests to
wait_for_route_batch) validate or clamp concurrent_requests to at least 1 before
building the batch—e.g., if concurrent_requests == 0 set it to 1 or return an
error/Result indicating invalid input—so wait_for_route_batch is never invoked
with a zero-sized batch.
---
Outside diff comments:
In `@engine/benches/ws_roundtrip_bench.rs`:
- Around line 55-57: The spawn currently swallows errors by doing `let _ =
builder.serve().await;` inside the `tokio::spawn` task (the `engine_task`),
losing the real startup failure; change the task to surface the `serve()` result
instead of discarding it — e.g., have the async move return the Result from
`builder.serve().await` (or call `.expect()`/`.unwrap()` with a clear message)
and then check the JoinHandle (`engine_task.await`) so any error from
`builder.serve()` is propagated/logged to the test harness; apply the same fix
to the other similar block(s) around lines 59-65 so no startup errors are
swallowed.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 7ddb3acc-d876-43b3-bc62-dc728c0ef8dc
📒 Files selected for processing (3)
engine/benches/http_blackbox/mod.rsengine/benches/http_concurrency_loopback_bench.rsengine/benches/ws_roundtrip_bench.rs
Summary by CodeRabbit