codeceptjs 4.0.2-beta.15 → 4.0.2-beta.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -119,6 +119,13 @@ let config
119
119
  // Load test and run
120
120
  initPromise = (async function () {
121
121
  try {
122
+ // Add staggered delay at the very start to prevent resource conflicts
123
+ const delay = (workerIndex - 1) * 500 // 0ms, 500ms, 1000ms, etc.
124
+ if (delay > 0) {
125
+ console.log(`[Worker ${workerIndex}] Waiting ${delay}ms to stagger initialization...`)
126
+ await new Promise(resolve => setTimeout(resolve, delay))
127
+ }
128
+
122
129
  console.log(`[Worker ${workerIndex}] Starting initialization...`)
123
130
 
124
131
  // Import modules dynamically to avoid ES Module loader race conditions in Node 22.x
@@ -163,13 +170,6 @@ initPromise = (async function () {
163
170
  const optsWithChild = { ...options, child: workerIndex }
164
171
  codecept = new Codecept(config, optsWithChild)
165
172
 
166
- // Add staggered delay to prevent resource conflicts (e.g., browser port conflicts)
167
- const delay = (workerIndex - 1) * 500 // 0ms, 500ms, 1000ms, etc.
168
- if (delay > 0) {
169
- console.log(`[Worker ${workerIndex}] Waiting ${delay}ms to stagger initialization...`)
170
- await new Promise(resolve => setTimeout(resolve, delay))
171
- }
172
-
173
173
  console.log(`[Worker ${workerIndex}] Initializing Codecept...`)
174
174
  try {
175
175
  await codecept.init(testRoot)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeceptjs",
3
- "version": "4.0.2-beta.15",
3
+ "version": "4.0.2-beta.16",
4
4
  "type": "module",
5
5
  "description": "Supercharged End 2 End Testing Framework for NodeJS",
6
6
  "keywords": [