Skip to content

Commit 0a6b17f

Browse files
committed
Workaround IO inhertiance in Marionette on Windows
1 parent eb0da48 commit 0a6b17f

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

rb/lib/selenium/webdriver/firefox/service.rb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ def stop
8181
end
8282
ensure
8383
stop_process
84+
if Platform.windows? && !$DEBUG
85+
@process.io.close rescue nil
86+
end
8487
end
8588

8689
def uri
@@ -95,7 +98,14 @@ def start_process
9598
server_command = [@executable_path, "--binary=#{Firefox::Binary.path}", "--webdriver-port=#{@port}", *@extra_args]
9699
@process = ChildProcess.build(*server_command)
97100

98-
@process.io.inherit! if $DEBUG || Platform.os == :windows
101+
if $DEBUG == true
102+
@process.io.inherit!
103+
elsif Platform.windows?
104+
# workaround stdio inheritance issue
105+
# https://github.com/jgraham/wires/issues/48
106+
@process.io.stdout = @process.io.stderr = File.new(Platform.null_device, 'w')
107+
end
108+
99109
@process.start
100110
end
101111

0 commit comments

Comments
 (0)