Skip to content

Commit 111380e

Browse files
bekcpearaduh95
authored andcommitted
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 <[email protected]>
1 parent c4d0229 commit 111380e

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

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

Lines changed: 1 addition & 0 deletions
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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,14 @@ 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}`,
54-
script,
52+
`--allow-fs-read=${script}`,
5553
];
54+
for (const file of mockFiles(nFiles, prefixPath)) {
55+
optionsWithScript.push('--allow-fs-read=' + file);
56+
}
57+
optionsWithScript.push(script);
5658
const warmup = 3;
5759
const state = { count, finished: -warmup };
5860
spawnProcess(optionsWithScript, bench, state);

0 commit comments

Comments
 (0)