Skip to content

Commit

Permalink
Stop using at_exit to shutdown playwright
Browse files Browse the repository at this point in the history
The processes of Playwright and headless browser can stop when the ruby
process terminates.
  • Loading branch information
mrkn committed May 31, 2024
1 parent 023d23c commit fdd041a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
4 changes: 0 additions & 4 deletions lib/charty/backends/backend_helpers/playwright_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@ module PlaywrightManager
@_context = nil
@_browser = nil
end

at_exit do
shutdown
end
end
end
end
Expand Down
11 changes: 1 addition & 10 deletions test/run.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,4 @@

require_relative "helper"

result = Test::Unit::AutoRunner.run(true, test_dir.to_s)

if defined? Charty::Backends::BackendHelpers::PlaywrightManager
require "timeout"
Timeout.timeout(60) do
Charty::Backends::BackendHelpers::PlaywrightManager.shutdown
end
end

exit(result)
exit(Test::Unit::AutoRunner.run(true, test_dir.to_s))

0 comments on commit fdd041a

Please sign in to comment.