mirror of
https://github.com/moltbot/moltbot.git
synced 2026-04-20 21:23:23 +00:00
fix(plugins): abort sibling boundary prep steps
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { createPrefixedOutputWriter } from "../../scripts/prepare-extension-package-boundary-artifacts.mjs";
|
||||
import {
|
||||
createPrefixedOutputWriter,
|
||||
runNodeStepsInParallel,
|
||||
} from "../../scripts/prepare-extension-package-boundary-artifacts.mjs";
|
||||
|
||||
describe("prepare-extension-package-boundary-artifacts", () => {
|
||||
it("prefixes each completed line and flushes the trailing partial line", () => {
|
||||
@@ -16,4 +19,25 @@ describe("prepare-extension-package-boundary-artifacts", () => {
|
||||
|
||||
expect(output).toBe("[boundary] first line\n[boundary] second line\n[boundary] third");
|
||||
});
|
||||
|
||||
it("aborts sibling steps after the first failure", async () => {
|
||||
const startedAt = Date.now();
|
||||
|
||||
await expect(
|
||||
runNodeStepsInParallel([
|
||||
{
|
||||
label: "fail-fast",
|
||||
args: ["--eval", "setTimeout(() => process.exit(2), 10)"],
|
||||
timeoutMs: 5_000,
|
||||
},
|
||||
{
|
||||
label: "slow-step",
|
||||
args: ["--eval", "setTimeout(() => {}, 10_000)"],
|
||||
timeoutMs: 5_000,
|
||||
},
|
||||
]),
|
||||
).rejects.toThrow("fail-fast failed with exit code 2");
|
||||
|
||||
expect(Date.now() - startedAt).toBeLessThan(2_000);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user