test: reduce WPT concurrency

PR-URL: https://github.com/nodejs/node/pull/47834
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
pull/47875/head
Filip Skokan 2023-05-05 10:40:33 +02:00 committed by GitHub
parent d55b84ba34
commit 3d003543b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 4 deletions

View File

@ -468,9 +468,10 @@ const limit = (concurrency) => {
};
class WPTRunner {
constructor(path) {
constructor(path, { concurrency = os.availableParallelism() - 1 || 1 } = {}) {
this.path = path;
this.resource = new ResourceLoader(path);
this.concurrency = concurrency;
this.flags = [];
this.globalThisInitScripts = [];
@ -595,7 +596,7 @@ class WPTRunner {
async runJsTests() {
const queue = this.buildQueue();
const run = limit(os.availableParallelism());
const run = limit(this.concurrency);
for (const spec of queue) {
const content = spec.getContent();

View File

@ -2,6 +2,6 @@
const { WPTRunner } = require('../common/wpt');
const runner = new WPTRunner('html/webappapis/timers');
const runner = new WPTRunner('html/webappapis/timers', { concurrency: 1 });
runner.runJsTests();

View File

@ -3,4 +3,4 @@ sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
import testpy
def GetConfiguration(context, root):
return testpy.ParallelTestConfiguration(context, root, 'wpt')
return testpy.SimpleTestConfiguration(context, root, 'wpt')