Skip to content
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

fix(core): use Date.now() everywhere for tasks start and end times to avoid negative durations #18595

Merged
merged 1 commit into from
Aug 15, 2023

Conversation

AgentEnder
Copy link
Member

Current Behavior

We use performance.now for start time and end time of tasks in the perf lifecycle hook, unless the tasks specify it (which is important for batch mode, when multiple tasks are reported at the same time but with different start and end times). Batch mode tasks report via Date.now instead, which can cause negative durations

Expected Behavior

No negative durations

Additional info

We decided to move away from performance.now here, partially because jest reports start and end time relative to UTC and it would be harder to compute.

Related Issue(s)

Closes #18388

@AgentEnder AgentEnder requested a review from a team as a code owner August 11, 2023 19:55
@vercel
Copy link

vercel bot commented Aug 11, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nx-dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 11, 2023 8:01pm

@FrozenPandaz FrozenPandaz merged commit 98a7477 into nrwl:master Aug 15, 2023
15 checks passed
FrozenPandaz pushed a commit that referenced this pull request Aug 16, 2023
… avoid negative durations (#18595)

(cherry picked from commit 98a7477)
@github-actions
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sometimes profiles have negative durations
3 participants