Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 414e9d2

Browse filesBrowse files
TrottBridgeAR
authored andcommitted
test: remove FIB environment variable from cpu-prof.js
PR-URL: #28183 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 066d814 commit 414e9d2
Copy full SHA for 414e9d2

File tree

Expand file treeCollapse file tree

3 files changed

+11
-16
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

3 files changed

+11
-16
lines changed
Open diff view settings
Collapse file

‎test/common/README.md‎

Copy file name to clipboardExpand all lines: test/common/README.md
+2-3Lines changed: 2 additions & 3 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -438,10 +438,9 @@ The `cpu-prof` module provides utilities related to CPU profiling tests.
438438

439439
### env
440440

441-
* Default: { ...process.env, FIB, NODE_DEBUG_NATIVE: 'INSPECTOR_PROFILER' }
441+
* Default: { ...process.env, NODE_DEBUG_NATIVE: 'INSPECTOR_PROFILER' }
442442

443-
Environment variables used in profiled processes. FIB will be set to `40` on
444-
Windows and `30` elsewhere.
443+
Environment variables used in profiled processes.
445444

446445
### getCpuProfiles(dir)
447446

Collapse file

‎test/common/cpu-prof.js‎

Copy file name to clipboardExpand all lines: test/common/cpu-prof.js
+1-12Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
'use strict';
44

5-
const common = require('./');
5+
require('./');
66
const fs = require('fs');
77
const path = require('path');
88
const assert = require('assert');
@@ -34,23 +34,12 @@ function verifyFrames(output, file, suffix) {
3434
assert.notDeepStrictEqual(frames, []);
3535
}
3636

37-
let FIB = 30;
38-
// This is based on emperial values - in the CI, on Windows the program
39-
// tend to finish too fast then we won't be able to see the profiled script
40-
// in the samples, so we need to bump the values a bit. On slower platforms
41-
// like the Pis it could take more time to complete, we need to use a
42-
// smaller value so the test would not time out.
43-
if (common.isWindows) {
44-
FIB = 40;
45-
}
46-
4737
// We need to set --cpu-interval to a smaller value to make sure we can
4838
// find our workload in the samples. 50us should be a small enough sampling
4939
// interval for this.
5040
const kCpuProfInterval = 50;
5141
const env = {
5242
...process.env,
53-
FIB,
5443
NODE_DEBUG_NATIVE: 'INSPECTOR_PROFILER'
5544
};
5645

Collapse file

‎test/fixtures/workload/fibonacci.js‎

Copy file name to clipboardExpand all lines: test/fixtures/workload/fibonacci.js
+8-1Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,12 @@ function fib(n) {
44
return fib(n - 1) + fib(n - 2);
55
}
66

7-
const n = parseInt(process.env.FIB) || 35;
7+
// This is based on emperial values - in the CI, on Windows the program
8+
// tend to finish too fast then we won't be able to see the profiled script
9+
// in the samples, so we need to bump the values a bit. On slower platforms
10+
// like the Pis it could take more time to complete, we need to use a
11+
// smaller value so the test would not time out.
12+
const FIB = process.platform === 'win32' ? 40 : 30;
13+
14+
const n = parseInt(process.env.FIB) || FIB;
815
process.stdout.write(`${fib(n)}\n`);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.