Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
ad565c40
Unverified
Commit
ad565c40
authored
Oct 11, 2021
by
Tobias Koppers
Committed by
GitHub
Oct 11, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avoid running multiple test from the same directory in parallel (#29830)
parent
e61068bf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
run-tests.js
run-tests.js
+11
-5
No files found.
run-tests.js
View file @
ad565c40
...
@@ -156,10 +156,6 @@ async function main() {
...
@@ -156,10 +156,6 @@ async function main() {
const
groupParts
=
groupArg
.
split
(
'/'
)
const
groupParts
=
groupArg
.
split
(
'/'
)
const
groupPos
=
parseInt
(
groupParts
[
0
],
10
)
const
groupPos
=
parseInt
(
groupParts
[
0
],
10
)
const
groupTotal
=
parseInt
(
groupParts
[
1
],
10
)
const
groupTotal
=
parseInt
(
groupParts
[
1
],
10
)
const
numPerGroup
=
Math
.
ceil
(
testNames
.
length
/
groupTotal
)
let
offset
=
groupPos
===
1
?
0
:
(
groupPos
-
1
)
*
numPerGroup
-
1
// if there's an odd number of suites give the first group the extra
if
(
testNames
.
length
%
2
!==
0
&&
groupPos
!==
1
)
offset
++
if
(
prevTimings
)
{
if
(
prevTimings
)
{
const
groups
=
[[]]
const
groups
=
[[]]
...
@@ -194,7 +190,9 @@ async function main() {
...
@@ -194,7 +190,9 @@ async function main() {
Math
.
round
(
groupTimes
[
curGroupIdx
])
+
's'
Math
.
round
(
groupTimes
[
curGroupIdx
])
+
's'
)
)
}
else
{
}
else
{
testNames
=
testNames
.
splice
(
offset
,
numPerGroup
)
const
numPerGroup
=
Math
.
ceil
(
testNames
.
length
/
groupTotal
)
let
offset
=
(
groupPos
-
1
)
*
numPerGroup
testNames
=
testNames
.
slice
(
offset
,
offset
+
numPerGroup
)
}
}
}
}
...
@@ -305,8 +303,15 @@ async function main() {
...
@@ -305,8 +303,15 @@ async function main() {
})
})
})
})
const
directorySemas
=
new
Map
()
await
Promise
.
all
(
await
Promise
.
all
(
testNames
.
map
(
async
(
test
)
=>
{
testNames
.
map
(
async
(
test
)
=>
{
const
dirName
=
path
.
dirname
(
test
)
let
dirSema
=
directorySemas
.
get
(
dirName
)
if
(
dirSema
===
undefined
)
directorySemas
.
set
(
dirName
,
(
dirSema
=
new
Sema
(
1
)))
await
dirSema
.
acquire
()
await
sema
.
acquire
()
await
sema
.
acquire
()
let
passed
=
false
let
passed
=
false
...
@@ -356,6 +361,7 @@ async function main() {
...
@@ -356,6 +361,7 @@ async function main() {
cleanUpAndExit
(
1
)
cleanUpAndExit
(
1
)
}
}
sema
.
release
()
sema
.
release
()
dirSema
.
release
()
})
})
)
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment