Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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
@AgentEnder AgentEnder requested a review from vsavkin 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

@nx-cloud
Copy link
Contributor

nx-cloud bot commented Aug 11, 2023

@FrozenPandaz FrozenPandaz merged commit 98a7477 into nrwl:master Aug 15, 2023
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
Contributor

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