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 cd10e25

Browse filesBrowse files
joyeecheungrvagg
authored andcommitted
process: move test-process-uptime to parallel
In addition, do not make too many assumptions about the startup time and timer latency in test-process-uptime. Instead only test that the value is likely in the correct unit (seconds) and it should be increasing in subsequent calls. PR-URL: #26206 Fixes: #26205 Refs: #26016 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
1 parent fde4011 commit cd10e25
Copy full SHA for cd10e25

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+6
-6
lines changed
Open diff view settings
Collapse file
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ require('../common');
2424
const assert = require('assert');
2525

2626
console.error(process.uptime());
27-
assert.ok(process.uptime() <= 2);
27+
// Add some wiggle room for different platforms.
28+
// Verify that the returned value is in seconds -
29+
// 15 seconds should be a good estimate.
30+
assert.ok(process.uptime() <= 15);
2831

2932
const original = process.uptime();
3033

3134
setTimeout(function() {
3235
const uptime = process.uptime();
33-
// some wiggle room to account for timer
34-
// granularity, processor speed, and scheduling
35-
assert.ok(uptime >= original + 2);
36-
assert.ok(uptime <= original + 3);
37-
}, 2000);
36+
assert.ok(original < uptime);
37+
}, 10);

0 commit comments

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