-
Notifications
You must be signed in to change notification settings - Fork 29.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Recently-introduced breaking change (unintentional?) in process.uptime() #26205
Comments
Actually, this looks like a genuine bug and not something flaky. |
fd0a861 seems like a likely culprit. /cc @joyeecheung |
Btw, the test doesn’t look like something that should go into |
Agreed. It can at least go in |
If we are only testing that the uptime is in the right unit, testing the initial value < 1000 should be fine? Or something like |
The 2 seconds that are currently in the test doesn’t seem like a bad value to me, but I think we had problems in the recent past with a test that relied on a fixed startup time limit. (I unfortunately don’t remember which test that was, so I don’t know what the problematic value was). |
@addaleax The current value in |
Fix in #26206 |
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: nodejs#26206 Fixes: nodejs#26205 Refs: nodejs#26016 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
In #26016 the result returned by process.uptime() was mistakenly set to be based in the wrong unit. This patch fixes the calculation and makes sure the returned value is in seconds. Refs: #26016 PR-URL: #26206 Fixes: #26205 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
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>
In #26016 the result returned by process.uptime() was mistakenly set to be based in the wrong unit. This patch fixes the calculation and makes sure the returned value is in seconds. Refs: #26016 PR-URL: #26206 Fixes: #26205 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
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>
https://ci.nodejs.org/job/node-test-commit-custom-suites/879/default/console
test-rackspace-ubuntu1604-x64-1
The text was updated successfully, but these errors were encountered: