Skip to content

Commit 3a6e924

Browse files
committed
update test concurrency for isolated tests
1 parent fed6184 commit 3a6e924

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

run-tests.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -329,9 +329,14 @@ async function main() {
329329
testNames.map(async (test) => {
330330
const dirName = path.dirname(test)
331331
let dirSema = directorySemas.get(dirName)
332-
if (dirSema === undefined)
333-
directorySemas.set(dirName, (dirSema = new Sema(1)))
334-
await dirSema.acquire()
332+
333+
if (!testType) {
334+
// limit integration tests to one active in a directory at a
335+
// time, isolated tests (e2e, dev, prod) don't need to be limited
336+
if (dirSema === undefined)
337+
directorySemas.set(dirName, (dirSema = new Sema(1)))
338+
await dirSema.acquire()
339+
}
335340
await sema.acquire()
336341
let passed = false
337342

@@ -383,7 +388,10 @@ async function main() {
383388
cleanUpAndExit(1)
384389
}
385390
sema.release()
386-
dirSema.release()
391+
392+
if (dirSema) {
393+
dirSema.release()
394+
}
387395
})
388396
)
389397

0 commit comments

Comments
 (0)