Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): make the remaining flaky server tests deterministic #22559

Mergedjuliusmarmingemerged 7 commits intomain fromrefs/pull/22559/headmerged by juliusmarminge View on GitHub

Showing 7 changed files with 42 additions and 17 deletions (loading 4).

x
0 of 7 viewed, 7 left
10 additions and 4 deletionsapps/server/scripts/acp-mock-agent.tsModified
View file
@@ -1466,9 +1466,9 @@
if (exitAfterRunningCommandLaunch) {
+ // The test sends `_test/exit` once T3 has recorded the published processes.
yield* Effect.promise(() => runningCommandPublished);
- yield* Effect.sleep("100 millis");
- return yield* Effect.sync(() => process.exit(0));
+ return yield* Effect.never;
while (!cancelledSessions.has(requestedSessionId)) {
yield* Effect.sleep("25 millis");
@@ -2448,8 +2448,14 @@
return Effect.succeed({});
- yield* agent.handleUnknownExtNotification((method) =>
- method === "_test/exit" ? Effect.sync(() => process.exit(19)) : Effect.void,
+ yield* agent.handleUnknownExtNotification((method, params) =>
+ method === "_test/exit"
+ ? Effect.sync(() => {
+ const code =
+ typeof params === "object" && params !== null ? Reflect.get(params, "code") : undefined;
+ process.exit(typeof code === "number" ? code : 19);
+ })
+ : Effect.void,
return yield* Effect.never;