| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
This commit simplifies the logic for tracking test start time. The start time is now set only when a test/suite begins running. If the test/suite never runs, a fallback is provided in postRun().
|
Review requested:
|
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
There was a problem hiding this comment.
Not sure I get why these changed
Sorry, something went wrong.
There was a problem hiding this comment.
The spec reporter only shows times if they are non-zero. Those values were coming through as zeros before. I have now updated the PR as shown below. That seems to keep the snapshots the same, which can also save a second hrtime() call. Please take another look.
diff --git a/lib/internal/test_runner/test.js b/lib/internal/test_runner/test.js
index f61aada409..9f9c47edae 100644
--- a/lib/internal/test_runner/test.js
+++ b/lib/internal/test_runner/test.js
@@ -754,8 +754,8 @@ class Test extends AsyncResource {
postRun(pendingSubtestsError) {
// If the test was cancelled before it started, then the start and end
// times need to be corrected.
- this.startTime ??= hrtime();
this.endTime ??= hrtime();
+ this.startTime ??= this.endTime;
// The test has run, so recursively cancel any outstanding subtests and
// mark this test as failed if any subtests failed.
Sorry, something went wrong.
This commit simplifies the logic for tracking test end time. The end time is now only set in postRun(), which every test runs when it ends.
Sorry, something went wrong.
This commit simplifies the logic for tracking test start time. The start time is now set only when a test/suite begins running. If the test/suite never runs, a fallback is provided in postRun(). PR-URL: #52182 Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
This commit simplifies the logic for tracking test end time. The end time is now only set in postRun(), which every test runs when it ends. PR-URL: #52182 Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
There was a problem hiding this comment.
Nice
Sorry, something went wrong.
This commit simplifies the logic for tracking test start time. The start time is now set only when a test/suite begins running. If the test/suite never runs, a fallback is provided in postRun(). PR-URL: #52182 Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
This commit simplifies the logic for tracking test end time. The end time is now only set in postRun(), which every test runs when it ends. PR-URL: #52182 Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
This commit simplifies the logic for tracking test start time. The start time is now set only when a test/suite begins running. If the test/suite never runs, a fallback is provided in postRun(). PR-URL: #52182 Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
This commit simplifies the logic for tracking test end time. The end time is now only set in postRun(), which every test runs when it ends. PR-URL: #52182 Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
| Back | FazBrowse Home | New Git URL |
This PR simplifies some of the logic that has accumulated over time for tracking test durations.
test_runner: simplify test start time tracking
This commit simplifies the logic for tracking test start time.
The start time is now set only when a test/suite begins running.
If the test/suite never runs, a fallback is provided in postRun().
test_runner: simplify test end time tracking
This commit simplifies the logic for tracking test end time.
The end time is now only set in postRun(), which every test
runs when it ends.