build-canaries/nevergreen

Building time incorrect if rebuilds trigger between polling intervals

GentlemanHal opened this issue · 1 comments

Bug report

How are you running?
nevergreen.io

Nevergreen version?
v4.0.0+1882.fa07b87 Orange Soda

What are you running on?
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36

Which CI server(s) are you monitoring?
N/A

Expected behaviour?
The building time should be correct.

Actual behaviour?
The building time is incorrect.

This can happen as the time the project started building is not part of the CCTray XML spec, so we need to calculate the building time ourselves. This is done from the first time Nevergreen sees the project building until the project status changes to a non building status. This was never going to be an accurate building time but in general is close enough to be useful.

The issue is when builds are queued and the next build starts between polling intervals. This means Nevergreen continues to see the project in the building status and so doesn't reset the started building time. This can cause the build time to be dramatically increased from the average as multiple builds are rolled into a single building time by Nevergreen.

Steps to reproduce?
N/A

Potential fix?
We could potentially also check the build label and if that has changed reset the started building time.

I've noticed for CircleCI the build label gets updated for every job in the pipeline 🤔

For example Nevergreen has "build", "deploy-staging" and "journey-tests" and these all display on the Monitor page as just "Nevergreen" but the building time now resets for each job.

Currently I'm thinking this is still better than combining different runs of the same pipelines in servers like Jenkins.