Fix file descriptor leak with Capybara
When Capybara is used in a debugger in feature specs, developers will often see "Too many open files". As described in https://github.com/teamcapybara/capybara/issues/2322, it appears that this may be an issue with WebMock, which stops `Net::HTTP.start` from connecting. If you start a connection and issue multiple requests with it, WebMock will create a new connection per request. Setting `net_http_connect_on_start: true` appears to fix the problem: https://github.com/bblimke/webmock/blob/master/README.md Many specs depending on the behavior of WebMock stubbing Net::HTTP.start, so use the WebMock default behavior in most cases and enable it only for feature specs. Kubeclient needs an exception because as well, so add a :kubeclient label for this.
显示
- ee/spec/features/clusters/cluster_health_dashboard_spec.rb 1 个添加, 1 个删除ee/spec/features/clusters/cluster_health_dashboard_spec.rb
- ee/spec/features/markdown/metrics_spec.rb 1 个添加, 1 个删除ee/spec/features/markdown/metrics_spec.rb
- spec/features/projects/environments_pod_logs_spec.rb 1 个添加, 1 个删除spec/features/projects/environments_pod_logs_spec.rb
- spec/features/projects/serverless/functions_spec.rb 1 个添加, 1 个删除spec/features/projects/serverless/functions_spec.rb
- spec/support/capybara.rb 11 个添加, 0 个删除spec/support/capybara.rb
- spec/support/kubeclient.rb 10 个添加, 0 个删除spec/support/kubeclient.rb
- spec/support/webmock.rb 17 个添加, 1 个删除spec/support/webmock.rb
加载中
想要评论请 注册 或 登录