mirror of https://github.com/nodejs/node.git
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
parent
d55b84ba34
commit
3d003543b7
|
@ -468,9 +468,10 @@ const limit = (concurrency) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
class WPTRunner {
|
class WPTRunner {
|
||||||
constructor(path) {
|
constructor(path, { concurrency = os.availableParallelism() - 1 || 1 } = {}) {
|
||||||
this.path = path;
|
this.path = path;
|
||||||
this.resource = new ResourceLoader(path);
|
this.resource = new ResourceLoader(path);
|
||||||
|
this.concurrency = concurrency;
|
||||||
|
|
||||||
this.flags = [];
|
this.flags = [];
|
||||||
this.globalThisInitScripts = [];
|
this.globalThisInitScripts = [];
|
||||||
|
@ -595,7 +596,7 @@ class WPTRunner {
|
||||||
async runJsTests() {
|
async runJsTests() {
|
||||||
const queue = this.buildQueue();
|
const queue = this.buildQueue();
|
||||||
|
|
||||||
const run = limit(os.availableParallelism());
|
const run = limit(this.concurrency);
|
||||||
|
|
||||||
for (const spec of queue) {
|
for (const spec of queue) {
|
||||||
const content = spec.getContent();
|
const content = spec.getContent();
|
||||||
|
|
|
@ -2,6 +2,6 @@
|
||||||
|
|
||||||
const { WPTRunner } = require('../common/wpt');
|
const { WPTRunner } = require('../common/wpt');
|
||||||
|
|
||||||
const runner = new WPTRunner('html/webappapis/timers');
|
const runner = new WPTRunner('html/webappapis/timers', { concurrency: 1 });
|
||||||
|
|
||||||
runner.runJsTests();
|
runner.runJsTests();
|
||||||
|
|
|
@ -3,4 +3,4 @@ sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
|
||||||
import testpy
|
import testpy
|
||||||
|
|
||||||
def GetConfiguration(context, root):
|
def GetConfiguration(context, root):
|
||||||
return testpy.ParallelTestConfiguration(context, root, 'wpt')
|
return testpy.SimpleTestConfiguration(context, root, 'wpt')
|
||||||
|
|
Loading…
Reference in New Issue