Capture artifacts when E2E test jobs time out
Problem
When an E2E test job hangs and times out during the step_script, the after_script does not run so we don't get any application logs. This makes it difficult to debug jobs that timeout, as seen in gitlab-org/gitlab#558136 (comment 2668634083)
Examples
In the following jobs:
- https://gitlab.com/gitlab-org/gitlab/-/jobs/10785200667
- https://gitlab.com/gitlab-org/gitlab/-/jobs/10785716264
- https://gitlab.com/gitlab-org/gitlab/-/jobs/10711802316
- https://gitlab.com/gitlab-org/gitlab/-/jobs/10688724551
- https://gitlab.com/gitlab-org/gitlab/-/jobs/10624862574
- https://gitlab.com/gitlab-org/gitlab/-/jobs/10616194698
- https://gitlab.com/gitlab-org/gitlab/-/jobs/10595559853
- https://gitlab.com/gitlab-org/gitlab/-/jobs/10585370781
- https://gitlab.com/gitlab-org/gitlab/-/jobs/10585821108
- https://gitlab.com/gitlab-org/gitlab/-/jobs/10583079255
- https://gitlab.com/gitlab-org/gitlab/-/jobs/10562197159
- https://gitlab.com/gitlab-org/gitlab/-/jobs/10548564892
- https://gitlab.com/gitlab-org/gitlab/-/jobs/10542715365
the E2E tests timeout but the artifacts aren't captured.
Possible solution
We can allow the after script to still execute so we can capture app logs and debug further
See: https://docs.gitlab.com/ci/runners/configure_runners/#set-script-and-after_script-timeouts
Edited by Jay McCure