Workers SDK Issue Reports

← Back to Dashboard

#7954 Error running tests with singleWorker: false

Recommendation:KEEP OPEN
Difficulty:hard
Reasoning:

Valid bug with reproduction repo. Tracked internally (DEVX-1628). Intermittent connection refused errors when running 25-50+ test files with isolated runtimes. PR #8198 attempted fix but closed without merge.

Suggested Action:

Keep open - tracked internally, workaround is singleWorker: true

Analysis Report

Issue #7954 Review

Summary

Field Value
Title Error running tests in when using singleWorker: false
State OPEN
Created 2025-01-29
Updated 2025-11-26
Labels bug, vitest
Reporter tyler-goodwin

Issue Description

When running 25-50+ test files with vitest-pool-workers configured with singleWorker: false, tests intermittently fail with connection refused errors:

workerd/server/server.c++:3325: error: Fallback service failed to fetch module; 
exception = kj/async-io-unix.c++:1524: disconnected: connect(): Connection refused

The issue involves the vitest-pool-workers isolated runtimes feature failing under high concurrency with many test files.

Reproduction: https://github.com/tyler-goodwin/vitest-workerd-many-test-repro

Version Information

  • Reported version: vitest-pool-workers 0.6.4
  • Latest version: vitest-pool-workers 0.12.6
  • Version gap: 6 minor versions behind (0.6.4 -> 0.12.6)

Analysis

Comment Activity

  • 2 comments total
  • Maintainer response (2025-10-20): Tracked internally as DEVX-1628
  • Reporter follow-up (2025-11-26): Asked for updates, mentioned workaround attempts failed

Related Issues & PRs

  • PR #8198 (CLOSED without merge): "fix(vitest-pool-workers): singleWorker false should work regardless of files count" - attempted fix was abandoned
  • Issue #5942: Similar "isolated runtimes AssertionError" issue, also OPEN
  • Issue #11082: Related "Fallback service failed to fetch module; Connection refused" - maintainer confirmed as bug on backlog

Changelog Search

  • Issue #7954 not mentioned in vitest-pool-workers CHANGELOG.md
  • No changelog entries for "singleWorker" or "isolated runtime" fixes found

Code Status

The issue appears to be a fundamental concurrency/race condition in the isolated runtimes implementation when running many test files in parallel. The maintainer has acknowledged this internally (DEVX-1628) but no fix has been merged.

Recommendation

KEEP OPEN

Reasoning

  1. Valid bug: Well-documented with reproduction repo
  2. Actively tracked: Internal Jira ticket DEVX-1628 created by maintainer
  3. No fix merged: PR #8198 was closed without merge; issue remains unresolved
  4. Related issues confirm: #11082 shows same error pattern, maintainer confirmed as bug
  5. Recent engagement: Reporter followed up Nov 2025 requesting status

Difficulty Assessment

Hard - Involves complex concurrency in workerd isolated runtimes and module fetching infrastructure

Suggested Action

  • Keep open as valid tracked bug
  • No action needed from triage perspective - already properly tracked internally

Suggested Comment

This issue is being tracked internally (DEVX-1628) as noted by the maintainer. The intermittent connection refused errors when running many tests with singleWorker: false appear to be a race condition in the isolated runtimes implementation.

Workaround: Use singleWorker: true to avoid the concurrency issue, though this will reduce test parallelism.

We'll update this issue when there's progress on a fix.

Notes & Feedback (0)

No notes yet.

Add Note