[QA] Stop Service::Runner trying to remove a non-existent runner
The following discussion from gitlab-qa!220 (merged) should be addressed:
-
@mlapierre started a discussion: https://gitlab.com/gitlab-org/gitlab-qa/-/jobs/161645087
An error occurred in an `after(:context)` hook. Failure/Error: Service::Runner.new(@runner_name).remove! QA::Service::Shellout::CommandError: Command `docker rm -f qa-runner-1550165298` failed!
This is a problem in quarantine jobs. clone_using_deploy_key_spec.rb
starts a runner in before(:all)
, but that will be skipped if the whole context
is skipped. Then the after hook tries to remove a non-existent runner.
We could skip after
hooks when quarantined before
hooks are skipped, but that might skip some necessary cleanup (which is why RSpec's skip
feature doesn't skip after
hooks when before
hooks are skipped).
It might be better to update Service::Runner
to not try to remove a non-existent runner.