Exit RSpec early when PG::QueryCanceled happens
Context
This MR is to mitigate the impact of #402915 (closed) on the pipelines duration.
What does this MR do and why?
Exit RSpec early when a specs fails because an exception related to PG::QueryCanceled
happens.
We don't check for the PG::QueryCanceled
directly, because it is generally wrapped up in another exception. For instance in https://gitlab.com/gitlab-org/gitlab/-/jobs/4518566961, we see the following errors:
#<ActionView::Template::Error: PG::QueryCanceled: ERROR: canceling statement due to statement timeout
#<ActiveRecord::QueryCanceled: PG::QueryCanceled: ERROR: canceling statement due to statement timeout
I've seen others wrapped in Grape exceptions.
Does it work?
In !124438 (2e8d0892), I'm raising an error similar to the ones we see in failing jobs (e.g. an wrapper error that contains a message about QueryCanceled
).
The job failed after 4min
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.