test(rivetkit): cover failed preflight disconnect handling#4973
test(rivetkit): cover failed preflight disconnect handling#4973NathanFlurry merged 1 commit intomainfrom
Conversation
Code Review: test(rivetkit): cover failed preflight disconnect handlingOverviewThis PR adds test coverage for the scenario where a connection transport closes (or the preflight is rejected) during the preflight phase, verifying that
IssuesNarrow test matrix (most important) The new TS driver test is the only test in the suite that restricts {
encodings: ["bare"],
runtimes: ["wasm"], // only test in the suite to restrict this
sqliteBackends: ["remote"],
}Every other driver test (e.g. Incomplete snapshot assertions The test asserts that
These would lock in the full contract of the behavior being tested and prevent regressions in counter accounting. MinorRust test: 20 ms hard-coded timeout if let Ok(Some(ActorEvent::ConnectionClosed { conn })) =
tokio::time::timeout(Duration::from_millis(20), events_rx.recv()).awaitTesting for the absence of an event necessarily requires a time bound, so some wall-clock wait is unavoidable here. 20 ms is reasonable in practice, but could be marginal on very slow CI workers. Matches the pattern already established in the file for other absence checks, so acceptable as-is. Rust test: unchecked reply.send(Err(anyhow::anyhow!("reject after transport close")));The return value is silently discarded. The existing tests in this file follow the same convention (lines 94, 107, 144), so it's consistent — worth noting as a pattern to clean up if the oneshot sender type is ever changed. Positive notes
|
e987ebe to
342f41d
Compare

Description
Please include a summary of the changes and the related issue. Please also include relevant motivation and context.
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
Checklist: