Workflow Job run duration metrics are always "+Inf" #3522
Labels
bug
Something isn't working
community
Community contribution
needs triage
Requires review from the maintainers
Checks
Controller Version
v0.27.6
Helm Chart Version
0.23.7
CertManager Version
v1.10.1
Deployment Method
Helm
cert-manager installation
Not applicable to this issue but is installed correctly.
Checks
Resource Definitions
To Reproduce
Describe the bug
Workflow Job run duration metrics are always in the
+Inf
bucket due to a bug in the code used to determine the run time. It is relying on the following code to get the queued and started time:And then it subtracts the started time from the completion time to calculate the run duration of the job. However, the
"Waiting for a runner to pick up this job..."
and"Job is about to start running on the runner:"
lines only exist in the job output until the job is completed, at which point Github removes from from the output. When those lines aren't present,completedTime
is correct butstartedTime
is the zero value fortime.Time
, which means you end up with a run duration of eg.2562047h47m16.854775807s
. See https://go.dev/play/p/fPfsc6Wp-gm for example.Describe the expected behavior
The job duration metric should be correct.
Whole Controller Logs
I know it says not to omit this, but they are not relevant here and they contain repository information I'd rather not be public. There are no errors in the logs. Sorry. Let me know if you really want these and I'll find a private way to get them to you.
Whole Runner Pod Logs
Additional Context
Here are the job logs from the same job before and after the job is complete:
Before job is complete:
After job is complete:
I'll be submitting a PR to fix this shortlyPR which fixes the issue: #3532The text was updated successfully, but these errors were encountered: