mirror of
https://github.com/morluto/rea
synced 2026-10-26 06:16:17 -04:00
test(process): isolate child startup and assert cleanup recovery values
This commit is contained in:
@@ -274,7 +274,11 @@ it("resolves an artifact cleanup error when its scope owner later closes", async
|
||||
ok(await resources.read("fixture", 1)),
|
||||
);
|
||||
|
||||
expect(retried.ok).toBe(true);
|
||||
if (!retried.ok) throw retried.error;
|
||||
expect(retried.value).toEqual({
|
||||
bytes: Buffer.alloc(0),
|
||||
sha256: "0".repeat(64),
|
||||
});
|
||||
expect(first.error.cleanupIncomplete).toBe(false);
|
||||
expect(closes).toBe(2);
|
||||
await resources.close();
|
||||
@@ -350,7 +354,11 @@ it("keeps a runtime root until its descriptor cleanup owner is released", async
|
||||
const retried = await resources.run(async () =>
|
||||
ok(await resources.read("fixture", 1)),
|
||||
);
|
||||
expect(retried.ok).toBe(true);
|
||||
if (!retried.ok) throw retried.error;
|
||||
expect(retried.value).toEqual({
|
||||
bytes: Buffer.alloc(0),
|
||||
sha256: "0".repeat(64),
|
||||
});
|
||||
expect(first.error.cleanupIncomplete).toBe(false);
|
||||
await resources.release();
|
||||
expect(rootCloses).toBe(1);
|
||||
|
||||
@@ -10,7 +10,7 @@ describe("execFileBoundedOutput", () => {
|
||||
"-e",
|
||||
"process.stdout.write('x'.repeat(70000)); process.stderr.write('failure detail');",
|
||||
],
|
||||
{ env: process.env, limit: 64 * 1024 },
|
||||
{ env: {}, limit: 64 * 1024 },
|
||||
);
|
||||
expect(result.exitCode).toBe(0);
|
||||
expect(Buffer.byteLength(result.stdout)).toBeLessThan(64 * 1024 + 50);
|
||||
@@ -26,7 +26,7 @@ describe("execFileBoundedOutput", () => {
|
||||
"-e",
|
||||
"process.stdout.write('x'.repeat(70000)); process.stderr.write('package conflict'); process.exitCode = 1;",
|
||||
],
|
||||
{ env: process.env, limit: 64 * 1024 },
|
||||
{ env: {}, limit: 64 * 1024 },
|
||||
);
|
||||
expect(result.exitCode).toBe(1);
|
||||
expect(result.stderr).toBe("package conflict");
|
||||
@@ -40,7 +40,7 @@ describe("execFileBoundedOutput", () => {
|
||||
"-e",
|
||||
"process.stderr.write('warning '.repeat(10000)); process.stderr.write('error: final conflict'); process.exitCode = 1;",
|
||||
],
|
||||
{ env: process.env, limit: 64 * 1024 },
|
||||
{ env: {}, limit: 64 * 1024 },
|
||||
);
|
||||
expect(result.exitCode).toBe(1);
|
||||
expect(result.stderr).toContain("[output omitted]");
|
||||
|
||||
Reference in New Issue
Block a user