Skip to content
Source
Sign inSign up
pingdotgg/t3code

test(server): Claude steer test no longer hangs for 120s under CI load #22533

Mergedt3dotgg(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/22533/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

Showing 1 changed file with 22 additions and 12 deletions.

x
0 of 1 viewed, 1 left
22 additions and 12 deletionsapps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.tsModified
View file
@@ -17500,6 +17500,7 @@
const FINISHED_TOOL_USE_ID = "toolu-steer-finished";
const calls: Array<string> = [];
let beforeAnswer: Effect.Effect<void> = Effect.void;
+ const lateAnswer = yield* Deferred.make<void>();
const harness = yield* makeWakeHarnessWithOptions({
backgroundTasks: (toolUseId) =>
Effect.sync(() => calls.push(toolUseId)).pipe(
@@ -17517,7 +17518,7 @@
: backgrounding === "never answers"
? Effect.never
: backgrounding === "answers after the steer went out"
- ? Effect.sleep("6 seconds").pipe(Effect.as(true))
+ ? Deferred.await(lateAnswer).pipe(Effect.as(true))
: Effect.succeed(true),
@@ -17670,16 +17671,29 @@
+ // The steer arms its 5-second backgrounding timeout after the request
+ // starts on another fiber, so one TestClock.adjust can land before that
+ // timer exists and leave the steer waiting forever. Tick until it ends.
+ const awaitSteerTimeout = <A, E>(fiber: Fiber.Fiber<A, E>) =>
+ Effect.gen(function* () {
+ for (let tick = 0; tick < 100 && fiber.pollUnsafe() === undefined; tick++) {
+ yield* TestClock.adjust("1 second");