From a8a54a6d25400546e338e37eb4120f88175cdcee Mon Sep 17 00:00:00 2001 From: Ryan Tsien Date: Sun, 19 May 2024 04:37:31 +0800 Subject: [PATCH] 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 PR-URL: https://github.com/nodejs/node/pull/51528 Reviewed-By: Luigi Pinca Reviewed-By: James M Snell Reviewed-By: Antoine du Hamel --- benchmark/permission/permission-processhas-fs-read.js | 1 + benchmark/permission/permission-startup.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/benchmark/permission/permission-processhas-fs-read.js b/benchmark/permission/permission-processhas-fs-read.js index bd81814e55861a..e0b2efdb3b2f74 100644 --- a/benchmark/permission/permission-processhas-fs-read.js +++ b/benchmark/permission/permission-processhas-fs-read.js @@ -13,6 +13,7 @@ const options = { flags: [ '--experimental-permission', `--allow-fs-read=${rootPath}`, + '--allow-child-process', ], }; diff --git a/benchmark/permission/permission-startup.js b/benchmark/permission/permission-startup.js index c800706299bb23..08326909aa4e41 100644 --- a/benchmark/permission/permission-startup.js +++ b/benchmark/permission/permission-startup.js @@ -47,10 +47,10 @@ function spawnProcess(script, bench, state) { function main({ count, script, nFiles, prefixPath }) { script = path.resolve(__dirname, '../../', `${script}.js`); - const files = mockFiles(nFiles, prefixPath).join(','); const optionsWithScript = [ '--experimental-permission', - `--allow-fs-read=${files},${script}`, + `--allow-fs-read=${script}`, + ...mockFiles(nFiles, prefixPath).map((file) => '--allow-fs-read=' + file), script, ]; const warmup = 3;