Skip to content

Test suite flakes under parallel runs: hard-coded port 8443 and an audit-write read race #39

Description

@V3RON

Observed repeatedly while running the cordierite package suite in several worktrees at once (nine parallel checkouts on one machine).

  1. Hard-coded wssPort: 8443. packages/cordierite/src/__tests__/rpc-client.test.ts, daemon.test.ts and daemon-cli.integration.test.ts start real daemons on the default port, so two suites on one host collide with EADDRINUSE 0.0.0.0:8443. The e2e harness already solves this with pickFreePort() (src/__tests__/e2e/harness.ts); the unit/integration fixtures should do the same, or write wssPort: 0 into the temp config.json if the daemon supports ephemeral ports.

  2. client.e2e.test.ts reads the audit file immediately after calls. daemon/audit.ts queues writes and returns before they land, so under load the test intermittently misses the last records (no_such_tool, deleteAll). Wait for the records (poll the file, or expose flush through daemon.status/a test seam) instead of reading straight away.

  3. daemon-restart.e2e.test.ts (SIGKILL recovery) fails deterministically in sandboxes that do not reap detached children: process.kill(pid, 0) keeps succeeding for the killed daemon, so the stale-pidfile takeover never fires. Worth either a CI-only skip with the reason, or making liveness detection tolerate a zombie (e.g. check /proc/<pid>/status state on Linux).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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