Skip to content

Commit bb844de

Browse files
bekcpeartargos
authored andcommittedMay 21, 2024
benchmark: fix api restriction for the permission category
give appropriate permissions to the following scripts: * permission-processhas-fs-read.js: 'ChildProcess' permission * permission-startup.js: 'FileSystemRead' permission > Paths delimited by comma (,) are no longer allowed. Refs: https://github.com/nodejs/node/blob/main/doc/api/cli.md#--allow-fs-read Signed-off-by: Ryan Qian <i@bitbili.net> PR-URL: #51528 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
1 parent 6d8589e commit bb844de

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed
 

‎benchmark/permission/permission-processhas-fs-read.js

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const options = {
1313
flags: [
1414
'--experimental-permission',
1515
`--allow-fs-read=${rootPath}`,
16+
'--allow-child-process',
1617
],
1718
};
1819

‎benchmark/permission/permission-startup.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ function spawnProcess(script, bench, state) {
4747

4848
function main({ count, script, nFiles, prefixPath }) {
4949
script = path.resolve(__dirname, '../../', `${script}.js`);
50-
const files = mockFiles(nFiles, prefixPath).join(',');
5150
const optionsWithScript = [
5251
'--experimental-permission',
53-
`--allow-fs-read=${files},${script}`,
52+
`--allow-fs-read=${script}`,
53+
...mockFiles(nFiles, prefixPath).map((file) => '--allow-fs-read=' + file),
5454
script,
5555
];
5656
const warmup = 3;

0 commit comments

Comments
 (0)