Skip to content

Investigate flaky session-manager integration tests (formerly skipIf-CI) #905

@mohidmakhdoomi

Description

@mohidmakhdoomi

Context

packages/codev/src/terminal/__tests__/session-manager.test.ts has 3 integration tests that were originally guarded by `it.skipIf(!!process.env.CI)` — meaning they were skipped on CI but expected to run locally. They legitimately spawn real shellper processes.

While working on #903, the builder observed these 3 tests timing out locally (15s timeout exceeded) and proposed converting them to plain `it.skip`. That change was reverted from PR #904 as out-of-scope. This issue tracks proper investigation.

Affected tests

In `packages/codev/src/terminal/tests/session-manager.test.ts` (line numbers as of revert):

  1. `'respects maxRestarts limit'` (around line 1020)
  2. `'logs session exit without stderr tail (stderr goes to file)'` (around line 1724)
  3. `'no stderr tail logged for file-based stderr (Bugfix Shellper processes do not survive Tower restart despite detached:true #324)'` (around line 1834)

What to investigate

  • Reproduce the 15s timeout locally. Is it environment-specific (WSL, slow disk, node-pty build) or universal?
  • Is the timeout legitimate (test needs more time) or pathological (deadlock, missing event, async leak)?
  • Should these tests:
    • Get a longer timeout and stay enabled locally, or
    • Move to a separate `pnpm test:integration` script and be excluded from default `pnpm test`, or
    • Be rewritten to not spawn real processes, or
    • Be deleted if redundant with other coverage
  • Original author's intent: why was the original `skipIf(CI)` chosen? Check `git blame` for context.

Out of scope

  • Don't simply re-skip and call it done — the point of this issue is to actually understand and decide.

Triggered by

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions