Get unique environment variable to detect a 'retry' of job

At Cypress.io, we load balance end-to-end tests and part of this functionality is dependent on looking at the environment variables to tie jobs from different machines together.

When you ‘retry’ a job manually, everything goes wrong - the retried job has the exact same environment variables as the initially run job.

Is there a way to detect if a job has been retried, to uniquely identify it from the initially run job?

1 Like

Just wondering the same, so… “bump” I guess? My use case would be enable some verbose logging in a job when it’s retried.

1 Like

I tried to get something going using cache and artifacts, but they do not seem to get passed in from the previous job when you retry.

This would be really helpful for some jobs where the first job should be run ‘optimistically’ and then the next execution should include new flags like ‘–force’ instead of having to build out jobs with dependencies for the same behavior.