Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): repeated capture timeouts no longer delay turn starts #29196

Mergedvoltcrash(GitHub profile, opens in a new tab)merged 2 commits intomain fromrefs/pull/29196/headmerged by maria-rcks View on GitHub

Showing 2 changed files with 126 additions and 4 deletions (loading 1).

x
0 of 2 viewed, 2 left
126 additions and 4 deletionsapps/server/src/orchestration-v2/CheckpointService.test.tsModified
View file
@@ -11,6 +11,7 @@
VcsProcessTimeoutError,
VcsUnsupportedOperationError,
} from "@t3tools/contracts";
+import * as Cause from "effect/Cause";
import * as DateTime from "effect/DateTime";
import * as Deferred from "effect/Deferred";
import * as Effect from "effect/Effect";
@@ -164,12 +165,23 @@
assert.strictEqual((yield* Fiber.join(postTurn)).status, "ready");
assert.strictEqual((yield* Fiber.join(waitingBaseline))._tag, "Success");
​
- const slowBaseline = yield* checkpoints
- .captureBaseline({ scope, ordinalWithinScope: 2 })
+ for (const ordinalWithinScope of [2, 3]) {
+ const slowBaseline = yield* checkpoints
+ .captureBaseline({ scope, ordinalWithinScope })
+ .pipe(Effect.result, Effect.forkChild);
+ yield* TestClock.adjust("5 seconds");
+ const result = yield* Fiber.join(slowBaseline);
+ assert.strictEqual(result._tag, "Failure");
+ if (result._tag === "Failure") {
+ assert.isTrue(Cause.isTimeoutError(result.failure.cause));
+ }
+ }
+ const backedOffBaseline = yield* checkpoints
+ .captureBaseline({ scope, ordinalWithinScope: 4 })
.pipe(Effect.result, Effect.forkChild);
yield* TestClock.adjust("5 seconds");