| 301 | } |
| 302 | |
| 303 | private finishSession(sessionId: string): void { |
| 304 | this.readySessions.add(sessionId) |
| 305 | |
| 306 | // the last worker finished running tests |
| 307 | if (this.readySessions.size === this.orchestrators.size) { |
| 308 | this._otel.span.end() |
| 309 | this._promise?.resolve() |
| 310 | this._promise = undefined |
| 311 | debug?.('[%s] all tests finished running', sessionId) |
| 312 | } |
| 313 | else { |
| 314 | debug?.( |
| 315 | `did not finish sessions for ${sessionId}: |ready - %s| |overall - %s|`, |
| 316 | [...this.readySessions].join(', '), |
| 317 | [...this.orchestrators.keys()].join(', '), |
| 318 | ) |
| 319 | } |
| 320 | } |
| 321 | |
| 322 | private runNextTest(method: 'run' | 'collect', sessionId: string): void { |
| 323 | const file = this._queue.shift() |