Skip to content

Commit 096ba37

Browse files
committed
test: skip cpu-intensive tests on slow hosts
The `test-tick-processor-*` tests are now passing everywhere except for the single-processor 700MHz Raspberry Pi 1 devices. The tests are CPU-intensive. Skip the tests if there is only one CPU and it runs at a speed not more than 700 MHz.
1 parent 782620f commit 096ba37

5 files changed

+23
-28
lines changed

test/common.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ exports.isLinux = process.platform === 'linux';
3131
exports.isOSX = process.platform === 'darwin';
3232

3333
exports.enoughTestMem = os.totalmem() > 0x40000000; /* 1 Gb */
34+
35+
const cpus = os.cpus();
36+
exports.enoughTestCpu = cpus.length > 1 || cpus[0].speed > 999;
37+
3438
exports.rootDir = exports.isWindows ? 'c:\\' : '/';
3539

3640
function rimrafSync(p) {

test/parallel/parallel.status

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,10 @@ prefix parallel
99
[$system==win32]
1010

1111
[$system==linux]
12-
test-tick-processor : PASS,FLAKY
1312

1413
[$system==macos]
1514

1615
[$arch==arm || $arch==arm64]
17-
test-tick-processor-builtin : PASS,FLAKY
18-
test-tick-processor-cpp-core : PASS,FLAKY
19-
test-tick-processor-unknown : PASS,FLAKY
2016

2117
[$system==solaris] # Also applies to SmartOS
2218

test/parallel/test-tick-processor-builtin.js

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,6 @@
22
const common = require('../common');
33
const path = require('path');
44

5-
// TODO(mhdawson) Currently the test-tick-processor functionality in V8
6-
// depends on addresses being smaller than a full 64 bits. Aix supports
7-
// the full 64 bits and the result is that it does not process the
8-
// addresses correctly and runs out of memory
9-
// Disabling until we get a fix upstreamed into V8
10-
if (common.isAix) {
11-
common.skip('Aix address range too big for scripts.');
12-
return;
13-
}
14-
15-
const base = require(path.join(common.fixturesDir, 'tick-processor-base.js'));
16-
175
if (common.isWindows ||
186
common.isSunOS ||
197
common.isAix ||
@@ -23,6 +11,13 @@ if (common.isWindows ||
2311
return;
2412
}
2513

14+
if (!common.enoughTestCpu) {
15+
common.skip('test is CPU-intensive');
16+
return;
17+
}
18+
19+
const base = require(path.join(common.fixturesDir, 'tick-processor-base.js'));
20+
2621
base.runTest({
2722
pattern: /Builtin_DateNow/,
2823
code: `function f() {

test/parallel/test-tick-processor-cpp-core.js

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,6 @@
22
const common = require('../common');
33
const path = require('path');
44

5-
// TODO(mhdawson) Currently the test-tick-processor functionality in V8
6-
// depends on addresses being smaller than a full 64 bits. Aix supports
7-
// the full 64 bits and the result is that it does not process the
8-
// addresses correctly and runs out of memory
9-
// Disabling until we get a fix upstreamed into V8
10-
if (common.isAix) {
11-
common.skip('Aix address range too big for scripts.');
12-
return;
13-
}
14-
15-
const base = require(path.join(common.fixturesDir, 'tick-processor-base.js'));
16-
175
if (common.isWindows ||
186
common.isSunOS ||
197
common.isAix ||
@@ -23,6 +11,13 @@ if (common.isWindows ||
2311
return;
2412
}
2513

14+
if (!common.enoughTestCpu) {
15+
common.skip('test is CPU-intensive');
16+
return;
17+
}
18+
19+
const base = require(path.join(common.fixturesDir, 'tick-processor-base.js'));
20+
2621
base.runTest({
2722
pattern: /RunInDebugContext/,
2823
code: `function f() {

test/parallel/test-tick-processor-unknown.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ if (common.isAix) {
1212
return;
1313
}
1414

15+
if (!common.enoughTestCpu) {
16+
common.skip('test is CPU-intensive');
17+
return;
18+
}
19+
1520
const base = require(path.join(common.fixturesDir, 'tick-processor-base.js'));
1621

1722
// Unknown checked for to prevent flakiness, if pattern is not found,

0 commit comments

Comments
 (0)