MCPcopy Index your code
hub / github.com/codeceptjs/CodeceptJS / run

Method run

lib/workers.js:500–525  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

498 }
499
500 async run() {
501 await this._ensureInitialized()
502 recorder.startUnlessRunning()
503 event.dispatcher.emit(event.workers.before)
504 store.workerMode = true
505 process.env.RUNS_WITH_WORKERS = 'true'
506
507 // Create workers and set up message handlers immediately (not in recorder queue)
508 // This prevents a race condition where workers start sending messages before handlers are attached
509 const workerThreads = []
510 for (const worker of this.workers) {
511 const workerThread = createWorker(worker, this.isPoolMode)
512 this._listenWorkerEvents(workerThread)
513 workerThreads.push(workerThread)
514 }
515
516 recorder.add('workers started', () => {
517 // Workers are already running, this is just a placeholder step
518 })
519
520 return new Promise(resolve => {
521 this.on('end', () => {
522 resolve()
523 })
524 })
525 }
526
527 /**
528 * @returns {Array<WorkerObject>}

Callers

nothing calls this directly

Calls 6

_ensureInitializedMethod · 0.95
_listenWorkerEventsMethod · 0.95
createWorkerFunction · 0.85
resolveFunction · 0.85
pushMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected