Skip to content

Commit 3881f5a

Browse files
cursoragentechobt
andcommitted
test(cli): accept interrupted abort frames under llvm-cov
Coverage instrumentation can delay the first turn so cancel arrives as turn_aborted / interrupted instead of a typed Error event. Co-authored-by: Mathis <echobt@users.noreply.github.com>
1 parent 4a6898f commit 3881f5a

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎src/cortex-cli/tests/exec_runtime.rs‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,14 +289,18 @@ fn a_second_turn_is_refused_while_one_is_running_and_the_budget_is_enforced() {
289289
assert_eq!(answer(3)["result"]["cancellation_requested"], true);
290290

291291
// The failing turn surfaces as an error/abort event, never as a completion.
292+
// llvm-cov slows the first turn so cancel can land as method `turn_aborted`
293+
// / reason `interrupted` before a typed Error event is emitted.
292294
assert!(
293295
frames.iter().any(|frame| {
294296
let event = &frame["params"]["event"];
295-
event["type"] == "Error" || event["type"] == "TurnAborted"
297+
event["type"] == "Error"
298+
|| event["type"] == "TurnAborted"
299+
|| event["reason"] == "interrupted"
296300
}) || frames.iter().any(|frame| {
297301
let msg = &frame["params"]["msg"];
298302
msg["type"] == "error" || msg["type"] == "turn_aborted"
299-
}),
303+
}) || frames.iter().any(|frame| frame["method"] == "turn_aborted"),
300304
"the unreachable service must produce a failure event: {frames:#?}"
301305
);
302306
assert!(

0 commit comments

Comments
 (0)