Skip to content

[Test] No un-quarantined test spawns a real OS thread — the worker protocol runs against fakes while the real-thread suites sit behind ACTOR_TS_SKIP_FLAKY_MNS #1186

Description

@pathosDev

Problem

No test in the WorkerCluster suite ever spawns a real OS thread. The unit suite runs the spawn/handshake/restart-policy protocol against an in-memory FakeWorkerBackend (deliberately, per its header comment), and the "end-to-end" WorkerMesh integration test stands up two systems in the same thread over a MessageChannel. The only suites that create genuine worker threads — parallel-pubsub and the ParallelMultiNodeSpec self-test — are exactly the ones quarantined behind ACTOR_TS_SKIP_FLAKY_MNS in every CI workflow (#538 tracks running those nightly).

Net effect: the protocol logic is well covered, but the threading itself — real worker_threads/Web Worker spawn, real postMessage clone semantics, real termination and the platform quirks the code already works around (Bun's self.onmessage delivery, the top-level-await handshake hang documented in WorkerNode) — is exercised by zero un-quarantined tests. A regression in the real backends (NodeWorkerBackend, WebWorkerBackend) would ship with the whole suite green.

Evidence

  • tests/unit/worker/WorkerCluster.test.ts:1-16 — header: protocol tests "against an in-memory FakeWorkerBackend. … The fake goes in through the backend option" ([Bug] mock.module in WorkerCluster.test.ts leaks a FakeWorkerBackend across the whole test run #520).
  • tests/integration/in-process/cluster/WorkerMesh.test.ts:44-55new MessageChannel() + MessageChannelTransport, both ends in the test's own thread.
  • The quarantine (ACTOR_TS_SKIP_FLAKY_MNS) is active in test.yml, publish.yml and multi-runtime.yml, so the badge-counted runs include no real-thread coverage.

Proposal

One small, deliberately boring smoke suite outside the quarantine: spawn a single real worker per backend (Node worker_threads; Bun/Deno Web Worker), handshake, round-trip one envelope, terminate, assert clean exit — sized to avoid the multi-worker respawn behaviour that makes the quarantined suites flaky on hosted runners (#325). That separates "threads work at all" (cheap, stable, always on) from "multi-node semantics over threads" (#538's nightly job).

Verification status

CONFIRMED-BY-READ — file headers and workflow greps on the v0.15.0 tree. From the independent production-readiness pass (2026-08-14), second batch. Related: #538 (nightly for quarantined suites), #325/#522 (quarantine history), #700/#702/#734 (worker restart-path issues that currently rely on fake-only coverage).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestinfrastructureCI / build / live-integration testspriority: lowNice-to-have / niche / demand-driven

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions