Skip to content

Commit 49d873e

Browse files
stephentoubCopilot
andcommitted
Make Rust E2E CI fail fast
Add a per-test E2E timeout and run Rust CI tests serially with uncaptured output so stuck replay-backed tests expose the active test instead of hanging silently. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 26f3f8b commit 49d873e

2 files changed

Lines changed: 20 additions & 3 deletions

File tree

.github/workflows/rust-sdk-tests.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,11 @@ jobs:
9494
run: pwsh.exe -Command "Write-Host 'PowerShell ready'"
9595

9696
- name: cargo test
97+
timeout-minutes: 90
9798
env:
9899
COPILOT_HMAC_KEY: ${{ secrets.COPILOT_DEVELOPER_CLI_INTEGRATION_HMAC_KEY }}
99100
COPILOT_CLI_PATH: ${{ steps.setup-copilot.outputs.cli-path }}
100-
run: cargo test --features test-support
101+
run: cargo test --features test-support -- --test-threads=1 --nocapture
101102

102103
# Validates the `embedded-cli` build path on all three supported
103104
# platforms. This is the only place `build.rs` actually runs (the

rust/tests/e2e/support.rs

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,18 @@ where
3232
let mut ctx = E2eContext::new(category, snapshot_name)
3333
.await
3434
.unwrap_or_else(|err| panic!("create E2E context: {err}"));
35-
test(&mut ctx).await;
36-
ctx.cleanup(false)
35+
36+
let timed_out = tokio::time::timeout(default_test_timeout(), test(&mut ctx))
37+
.await
38+
.is_err();
39+
ctx.cleanup(timed_out)
3740
.await
3841
.unwrap_or_else(|err| panic!("clean up E2E context: {err}"));
42+
assert!(
43+
!timed_out,
44+
"timed out after {:?} running E2E test {category}/{snapshot_name}",
45+
default_test_timeout()
46+
);
3947
}
4048

4149
pub struct E2eContext {
@@ -436,6 +444,14 @@ fn default_event_timeout() -> Duration {
436444
}
437445
}
438446

447+
fn default_test_timeout() -> Duration {
448+
if cfg!(windows) {
449+
Duration::from_secs(300)
450+
} else {
451+
Duration::from_secs(180)
452+
}
453+
}
454+
439455
pub fn get_system_message(exchange: &serde_json::Value) -> String {
440456
exchange
441457
.get("request")

0 commit comments

Comments
 (0)