Skip to content

test: resume.test.ts 'manual resume: suspended agent with sessionId is resumed' fails ONLY in full suite (cross-test PG pollution) #1273

@namastex888

Description

@namastex888

Summary

src/__tests__/resume.test.ts:109 test case resume > manual resume: suspended agent with sessionId is resumed passes reliably in isolation (10/10 runs, 3.6s) but fails consistently when invoked via full bun run check (3/3 attempts on 2026-04-21 at 10:40-11:05 UTC on dev HEAD 39bf0290).

Classic cross-test PG state pollution — not a load-dependent oscillating flake like the baseline-flake family (listen-bomb, spill-journal, SpawnTargetPicker).

Repro

cd /home/genie/workspace/agents/genie-configure/repos/genie
git checkout origin/dev  # 39bf0290 (v4.260421.12)

# Isolated — PASSES
bun test src/__tests__/resume.test.ts
# → 10 pass / 0 fail in 3.6s

# Full suite — FAILS consistently
bun run check
# → 3415 pass / 1 fail in ~128s
# → fail: "(fail) resume > manual resume: suspended agent with sessionId is resumed"
# → underlying error: postgres handler at node_modules/postgres/src/index.js:331

Impact

Root cause hypotheses

  1. Shared pgserve port 20900 not reset between test filessrc/__tests__/ and scripts/reconcile-orphans.test.ts both use pgserve --ram on port 20900. State bleed.
  2. FK cascade from sibling test — another test inserts an agent row that interferes with resume.test's suspended-agent fixture on cleanup.
  3. Test runner ordering — isolated run picks different order; full run exposes dependency on a prior test's rollback.

Related

Suggested next step

bun test src/__tests__/resume.test.ts --preload=<setup-that-forces-fresh-pgserve> to isolate. If isolates, fix is test harness-level (per-file pgserve reset, or serialize PG-touching test files).

Reported by the bugless-genie orchestrator during autonomous overnight work, 2026-04-21.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions