Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
route committed Dec 20, 2024
1 parent e3c933d commit 14c4f50
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ jobs:
with:
chrome-version: stable

- name: Fix Chrome
run: |
sudo chown root:root /opt/hostedtoolcache/setup-chrome/chromium/stable/x64/chrome-sandbox
sudo chmod 4755 /opt/hostedtoolcache/setup-chrome/chromium/stable/x64/chrome-sandbox
- name: Run tests
run: |
mkdir -p /tmp/ferrum
Expand Down
4 changes: 4 additions & 0 deletions lib/ferrum/browser/process.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ def start
end

env = Hash(@xvfb&.to_env).merge(@env)
puts "=================== #{@command.to_a.inspect}"
@pid = ::Process.spawn(env, *@command.to_a, process_options)
puts "=================== #{@pid}"
ObjectSpace.define_finalizer(self, self.class.process_killer(@pid))

parse_ws_url(read_io, @process_timeout)
Expand Down Expand Up @@ -154,6 +156,8 @@ def parse_ws_url(read_io, timeout)
while (now = Utils::ElapsedTime.monotonic_time) < max_time
begin
output += read_io.read_nonblock(512)
puts output
output
rescue IO::WaitReadable
read_io.wait_readable(max_time - now)
else
Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
end

config.after(:all) do
@browser.quit
@browser&.quit
end

config.before(:each) do
Expand Down

0 comments on commit 14c4f50

Please sign in to comment.