Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions e2e/perstack-cli/lazy-init.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down