interface GroupState

RunState scoped to a single concurrent group — one fresh object per group of a run.

import * as RunState from './setup/run-state.ts';

const group: GroupState = RunState.newGroup(1, [{ module: 'Cart' }]);
group.phase; // 'bundling' — every group starts before its bundle exists

Properties

index: number

Index within the run's group array; 0 for watch and single-group runs.

groupMode: boolean

true while running as one of several concurrent groups.

Callbacks the run pipeline waits on, resolved as the browser reaches each milestone.

phase: "bundling" | "connecting" | "loading" | "running" | "done"

Current lifecycle phase of this group's run.

selectors: QUnitSelector[] | undefined

Exact test selections for this group, derived from lineTargets. Applied in the browser via QUnit.config.testFilter, which QUnit ANDs after filter/module. Per-group: each line-targeted file runs as its own group so untargeted files stay unfiltered.

lastRanFiles: string[] | null

Test files this group ran on the last run. Failure attribution falls back to this when a failing assertion's stack can't be resolved to one file — scoped per group so an unattributable failure blames only the files that group ran, not the whole invocation.

Watch mode runs exactly one group, so this doubles as the ql rerun target there, and the qf fallback when the last run had no failures to scope to.

testEndCounts: Map<string, number>

Tracks testEnd arrivals per test fullName in this group's run. Reset in lockstep with the run counter — explicitly NOT on every WS 'connection' event, which was the bug that broke no-html-test in CI run 26042614416.

The WS testEnd handler enforces "QUnit fires testEnd exactly once per registered test per run" by checking this map before incrementing the counter: a second arrival of the same fullName is dropped with a # [qunitx] WARNING: duplicate testEnd ignored ... line on stderr+stdout so the underlying browser/runtime bug stays visible while pass counts stay correct. Per-group because two groups can legitimately share a fullName when they bundle different files registering the same module/test names — the dedup key is intra-group.

Diagnostic-only: how many distinct WS connections this group's wss handler has accepted. Reset per WebServer.setup call. > 1 means the browser opened multiple WebSocket connections within one run — the prime suspect for the 2× test-execution flake (WS retry path in the injected runtime).

QUNIT_RESULT delivered via the WS 'done' message; avoids a page.evaluate() CDP round-trip.

pendingConsoleHandlers: Set<Promise<void>> | null

In-flight console handler promises; awaited before browser/page close so Firefox BiDi round-trips complete.

Decoded inline source map for this group's bundle; resolves stack frames to original sources.

This group's bundle output and build bookkeeping.