fix(e2e): validate fixture cleanup interval

This commit is contained in:
Vincent Koc
2026-06-19 00:29:16 +02:00
parent 4ac192deef
commit 84bcdaa983
2 changed files with 50 additions and 2 deletions

View File

@@ -423,6 +423,40 @@ test -d "$OPENCLAW_PLUGINS_TMP_DIR"
expect(result.stdout).not.toContain("probe");
});
it("rejects invalid fixture stop intervals before cleanup polling", () => {
const result = spawnSync(
"/bin/bash",
[
"-c",
[
"set -euo pipefail",
"source scripts/e2e/lib/plugins/fixtures.sh",
"openclaw_plugins_signal_fixture_process() { echo signal; }",
"openclaw_plugins_fixture_process_alive() { echo probe; return 1; }",
"set +e",
"openclaw_plugins_stop_fixture_process 12345",
'status="$?"',
"set -e",
'exit "$status"',
].join("\n"),
],
{
cwd: process.cwd(),
encoding: "utf8",
env: {
...process.env,
OPENCLAW_PLUGINS_FIXTURE_STOP_ATTEMPTS: "2",
OPENCLAW_PLUGINS_FIXTURE_STOP_INTERVAL_SECONDS: "soon",
},
},
);
expect(result.status).toBe(2);
expect(result.stderr).toContain("invalid OPENCLAW_PLUGINS_FIXTURE_STOP_INTERVAL_SECONDS: soon");
expect(result.stdout).not.toContain("signal");
expect(result.stdout).not.toContain("probe");
});
it("bounds npm fixture registry logs when readiness fails", () => {
const root = mkdtempSync(path.join(tmpdir(), "openclaw-plugin-npm-fixture-log-"));
try {