GitLab FOSS merge requestshttps://staging.gitlab.com/gitlab-org/gitlab-foss/-/merge_requests2017-05-10T06:19:05Zhttps://staging.gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/9846Introduce a new middleware for the test environment that can block requests2017-05-10T06:19:05Zusername-removed-128633Introduce a new middleware for the test environment that can block requests## What does this MR do?
After digging into https://gitlab.com/gitlab-org/gitlab-ce/issues/28307#note_24958837, I thought there is probably a clean and robust solution to this issue other than tweaking assertions on a case-by-case basis...## What does this MR do?
After digging into https://gitlab.com/gitlab-org/gitlab-ce/issues/28307#note_24958837, I thought there is probably a clean and robust solution to this issue other than tweaking assertions on a case-by-case basis...
And then I found http://www.salsify.com/blog/engineering/tearing-capybara-ajax-tests. I implemented what's described in the article and I've never experienced a `PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_routes_on_source_type_and_source_id"` error again!
## Are there points in the code the reviewer needs to double check?
I don't there is any downside with this technique.
Closes #283079.1username-removed-443319username-removed-443319