Skip to content

Commit 3c6d04c

Browse files
authored
Merge pull request #17 from probitas-test/fix/timeout
Propagate abort reason from external signal in runner
2 parents 884e5d9 + 623e262 commit 3c6d04c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/probitas-runner/runner.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,10 @@ export class Runner {
7070
// Create abort controller for outer context
7171
const controller = new AbortController();
7272
const { signal } = controller;
73-
options?.signal?.addEventListener("abort", () => controller.abort());
73+
options?.signal?.addEventListener("abort", () => {
74+
// Pass the reason from external signal to internal controller
75+
controller.abort(options.signal?.reason);
76+
});
7477

7578
// Execute scenarios
7679
const maxConcurrency = options?.maxConcurrency ?? 0;

0 commit comments

Comments
 (0)