Skip to content

Commit 768c953

Browse files
committed
fix missing worker index in cli mode
1 parent 5c27c8a commit 768c953

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

lib/workers.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ class Workers extends EventEmitter {
604604
if (!this._testStates) this._testStates = new Map()
605605

606606
if (!this._testStates.has(uid)) {
607-
this._testStates.set(uid, { states: [], lastData: data })
607+
this._testStates.set(uid, { states: [], lastData: data, workerIndex: message.workerIndex })
608608
}
609609

610610
const testState = this._testStates.get(uid)
@@ -674,7 +674,10 @@ class Workers extends EventEmitter {
674674

675675
// Emit states for all tracked tests before emitting results
676676
if (this._testStates) {
677-
for (const [uid, { states, lastData }] of this._testStates) {
677+
for (const [uid, { states, lastData, workerIndex }] of this._testStates) {
678+
// Set correct worker index for output
679+
output.process(workerIndex)
680+
678681
// For tests with retries configured, emit all failures + final success
679682
// For tests without retries, emit only final state
680683
const lastState = states[states.length - 1]

0 commit comments

Comments
 (0)