It fixes Rails 5.0 deprecation flooding like:
```
DEPRECATION WARNING: Passing strings or symbols to the middleware builder is deprecated, please change
them to actual class references. For example:
"::Gitlab::Middleware::ReadOnly" => Gitlab::Middleware::ReadOnly
(called from <top (required)> at /builds/gitlab-org/gitlab-ce/config/environment.rb:11)
DEPRECATION WARNING: Passing strings or symbols to the middleware builder is deprecated, please change
them to actual class references. For example:
"ActionDispatch::Static" => ActionDispatch::Static
(called from <top (required)> at /builds/gitlab-org/gitlab-ce/config/environment.rb:11)
DEPRECATION WARNING: Passing strings or symbols to the middleware builder is deprecated, please change
them to actual class references. For example:
"Gitlab::Testing::RequestBlockerMiddleware" => Gitlab::Testing::RequestBlockerMiddleware
(called from <top (required)> at /builds/gitlab-org/gitlab-ce/config/environment.rb:11)
DEPRECATION WARNING: Passing strings or symbols to the middleware builder is deprecated, please change
them to actual class references. For example:
"ActionDispatch::Static" => ActionDispatch::Static
(called from <top (required)> at /builds/gitlab-org/gitlab-ce/config/environment.rb:11)
DEPRECATION WARNING: Passing strings or symbols to the middleware builder is deprecated, please change
them to actual class references. For example:
"Gitlab::Testing::RequestInspectorMiddleware" => Gitlab::Testing::RequestInspectorMiddleware
(called from <top (required)> at /builds/gitlab-org/gitlab-ce/config/environment.rb:11)
```
Enabling caching of classes slows start-up time because all controllers
are loaded at initialization, but it reduces memory and load because files
are not reloaded with every request. For example, caching is not necessary
for loading database migrations but useful for handling Knapsack specs.
Addresses gitlab-org/gitlab-ee#2162
The idea is that after each feature spec example, we block all incoming
requests at the Rack level, go to the 'about:blank' page, and wait until
the current requests reach 0.
This should solve the problem where a request would end after database
cleaner performed the database truncation. The problem was that a GET
request can still lead to records creation (e.g. namespaces or routes).
Signed-off-by: Rémy Coutable <remy@rymai.me>