You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here's a scenario where cuprite/ferrum does not exit and the test hangs indefinitely. We've written some concurrency/race-condition tests in our application that involves forking processes. This is resulting in our test suite hanging, and it looks like it may be related to cuprite/ferrum not stopping the browser process. Here is a simple reproduction case:
require"test_helper"require"capybara/cuprite"classApplicationSystemTestCase < ActionDispatch::SystemTestCasedriven_by:cupritetest"forking processes creates a non-exiting test"doprocess_pids=[1,2].mapdo |count|
Process.fork{puts"Working #{count}"sleep(1)puts"Done #{count}"exit!}endputs"PIDS are #{process_pids}"process_pids.each{ |pid| Process.waitpid(pid)}puts"Done waiting"visit"/"endend
When run this will not exit. I can see that the Chrome browser process is still active in my activity monitor. If I kill the browser, the runner exits.
Note this repro case is in test-unit, but we're seeing this issue in RSpec with the process forking happening in a model spec entirely separate from any cuprite-driven feature specs.
The text was updated successfully, but these errors were encountered:
Same thing happens to me.. Here's what I did to kill the pid at least until we can figure out what needs to get updated in cuprite.
Capybara / Cuprite / RSpec
RSpec.configure do |config|
config.before(:suite) do
# List all process using the port that we're about to use
pid_output = `lsof -i tcp:#{9500 + ENV['TEST_ENV_NUMBER'].to_i} | awk 'NR!=1 {print $2}'`
# Kill those processes if any were found
system("echo '#{pid_output}' | xargs kill -9") unless pid_output.strip.empty?
end
end
Here's a scenario where cuprite/ferrum does not exit and the test hangs indefinitely. We've written some concurrency/race-condition tests in our application that involves forking processes. This is resulting in our test suite hanging, and it looks like it may be related to cuprite/ferrum not stopping the browser process. Here is a simple reproduction case:
When run this will not exit. I can see that the Chrome browser process is still active in my activity monitor. If I kill the browser, the runner exits.
Note this repro case is in test-unit, but we're seeing this issue in RSpec with the process forking happening in a model spec entirely separate from any cuprite-driven feature specs.
The text was updated successfully, but these errors were encountered: