test: deflake background exec timeout
This commit is contained in:
@@ -63,7 +63,7 @@ test("background exec still times out after tool signal abort", async () => {
|
|||||||
abortController.abort();
|
abortController.abort();
|
||||||
|
|
||||||
let finished = getFinishedSession(sessionId);
|
let finished = getFinishedSession(sessionId);
|
||||||
const deadline = Date.now() + 2000;
|
const deadline = Date.now() + (process.platform === "win32" ? 10_000 : 2_000);
|
||||||
while (!finished && Date.now() < deadline) {
|
while (!finished && Date.now() < deadline) {
|
||||||
await sleep(20);
|
await sleep(20);
|
||||||
finished = getFinishedSession(sessionId);
|
finished = getFinishedSession(sessionId);
|
||||||
@@ -72,6 +72,7 @@ test("background exec still times out after tool signal abort", async () => {
|
|||||||
const running = getSession(sessionId);
|
const running = getSession(sessionId);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
expect(finished).toBeTruthy();
|
||||||
expect(finished?.status).toBe("failed");
|
expect(finished?.status).toBe("failed");
|
||||||
} finally {
|
} finally {
|
||||||
const pid = running?.pid;
|
const pid = running?.pid;
|
||||||
@@ -121,7 +122,7 @@ test("yielded background exec still times out", async () => {
|
|||||||
const sessionId = (result.details as { sessionId: string }).sessionId;
|
const sessionId = (result.details as { sessionId: string }).sessionId;
|
||||||
|
|
||||||
let finished = getFinishedSession(sessionId);
|
let finished = getFinishedSession(sessionId);
|
||||||
const deadline = Date.now() + 2000;
|
const deadline = Date.now() + (process.platform === "win32" ? 10_000 : 2_000);
|
||||||
while (!finished && Date.now() < deadline) {
|
while (!finished && Date.now() < deadline) {
|
||||||
await sleep(20);
|
await sleep(20);
|
||||||
finished = getFinishedSession(sessionId);
|
finished = getFinishedSession(sessionId);
|
||||||
@@ -130,6 +131,7 @@ test("yielded background exec still times out", async () => {
|
|||||||
const running = getSession(sessionId);
|
const running = getSession(sessionId);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
expect(finished).toBeTruthy();
|
||||||
expect(finished?.status).toBe("failed");
|
expect(finished?.status).toBe("failed");
|
||||||
} finally {
|
} finally {
|
||||||
const pid = running?.pid;
|
const pid = running?.pid;
|
||||||
|
|||||||
Reference in New Issue
Block a user