diff --git a/e2e/perstack-cli/lazy-init.test.ts b/e2e/perstack-cli/lazy-init.test.ts index 7f32ff93..ba0f8db1 100644 --- a/e2e/perstack-cli/lazy-init.test.ts +++ b/e2e/perstack-cli/lazy-init.test.ts @@ -110,11 +110,12 @@ describe.concurrent("Lazy Init", () => { // @perstack/base (lazyInit=false) should be connected BEFORE startRun expect(baseSkillEvent!.timestamp).toBeLessThanOrEqual(startRunEvent!.timestamp) - // Verify that startRun happens immediately after base connects (not waiting for attacker) - // The gap between base connected and startRun should be small (< 50ms) - // Using 50ms to account for event loop, GC pauses, and CI runner variability + // Verify that startRun happens soon after base connects (not waiting for attacker) + // With real-time lifecycle events, the gap includes time for other adapter setup + // between base's skillConnected and startRun. Using 200ms to account for + // event loop, GC pauses, stdio spawn overhead, and CI runner variability. const gapMs = startRunEvent!.timestamp - baseSkillEvent!.timestamp - expect(gapMs).toBeLessThan(50) + expect(gapMs).toBeLessThan(200) // Run should complete successfully const completeRunEvent = events.find((e) => e.type === "completeRun")