Skip to main content

Learn why the duration time displayed for a job in CircleCI may differ from the total duration of its individual steps

Overview

The duration time displayed for a job in CircleCI may differ from the total duration calculated by adding up the durations of its individual steps. This inconsistency can be confusing and raises questions about how the job duration is calculated.

Symptoms

When reviewing a job in a CircleCI pipeline, the top section of the page shows a duration time that doesn't match the total duration of the individual steps.

Possible Cause

The discrepancy in job duration can be attributed to the parallel execution of the job. While the individual steps may have completed much faster, the overall job duration accounts for the longest-running parallel run.

Resolution

To accurately assess the time taken by a job, follow these steps:

1. Navigate to the job page in CircleCI.

- Example job page URL: `

https://app.circleci.com/pipelines/<organization>/<repository>/<pipeline>/workflows/<workflow>/jobs/<job>

2. Scroll to the parallel runs section, typically displayed as tabs.

- Example parallel runs URL:

https://app.circleci.com/pipelines/<organization>/<repository>/<pipeline>/workflows/<workflow>/jobs/<job>/parallel-runs/<run>

3. Ensure that the filtering options are set to show all runs, including successful ones. By default, CircleCI may filter the runs and only display failed or incomplete ones.

4. Review the duration of each parallel run and identify the one with the longest duration. This duration represents the overall job duration displayed in the top section of the job page.

5. If the job has parallel steps, note that their durations may not sum up to the overall job duration, as parallel execution allows for concurrent processing.

Conclusion

The duration time displayed for a job in CircleCI may differ from the total duration of its individual steps due to parallel execution. By checking the parallel runs and identifying the longest duration, you can obtain the accurate job duration. If you have any further questions or encounter any additional issues, feel free to reach out to CircleCI support for assistance.

Please note that this article is a general guide and may not cover specific scenarios. It's always recommended to refer to the CircleCI documentation or contact our support team for detailed and up-to-date information.

Did this answer your question?