mvp-ai's picture
download
raw
1.3 kB
// Copyright (c) 2026 the Zuke contributors
// SPDX-License-Identifier: MIT
import {
assertEquals,
assertStringIncludes,
} from "../../packages/core/tests/_assert.ts";
import { Build, target } from "../../packages/core/mod.ts";
import { $ } from "../../packages/core/src/shell.ts";
import { runCli } from "./_harness.ts";
// A cooperative child (it does not trap SIGTERM) so the terminate sequence ends
// at the first signal and the test stays fast; the grace → SIGKILL escalation
// against a SIGTERM-proof child is covered by tests/e2e/kill_after_e2e.ts.
class SlowBuild extends Build {
slow = target()
.description("run a child that outlives its killAfter budget")
.executes(async () => {
await $`${Deno.execPath()} eval ${"await new Promise((r) => setTimeout(r, 30000))"}`
.quiet()
.killAfter(150);
});
}
Deno.test("a killAfter timeout fails the build through the CLI", async () => {
const started = performance.now();
const { code, err } = await runCli(SlowBuild, ["slow"]);
const elapsed = performance.now() - started;
assertEquals(code, 1);
assertStringIncludes(err, "timed out after 150ms");
// The child would have slept 30s: the timeout really reaped it.
assertEquals(elapsed < 15_000, true, `took ${Math.round(elapsed)}ms`);
});

Xet Storage Details

Size:
1.3 kB
·
Xet hash:
f7b689fd5faddfa340e260e429a1dac51dfeb86d7911abd313feb8b71b76dcf9

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.