Skip to content

Commit 2a0ac18

Browse files
committed
[rb] drop the SE_DEBUG output lock in the spec log-capture helper
1 parent 747e354 commit 2a0ac18

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

rb/spec/rspec_matchers.rb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,13 @@ def ids_in(line)
6969
end
7070

7171
# Suppresses logging output to stderr while capturing it, so an expected entry does not pollute
72-
# test output and an unexpected one still fails the assertion. SE_DEBUG locks the logger output,
73-
# making #output= a no-op, so ensure the lock is removed for the duration of the capture.
72+
# test output and an unexpected one still fails the assertion. SE_DEBUG locks the output to block
73+
# runtime overrides; the test suite has no such need, so drop the lock and leave it off.
7474
def capture_log_lines
7575
default_output = Selenium::WebDriver.logger.io
7676
io = StringIO.new
7777

78-
output_forced = Selenium::WebDriver.logger.instance_variable_get(:@output_forced)
79-
Selenium::WebDriver.logger.instance_variable_set(:@output_forced, false) if output_forced
78+
Selenium::WebDriver.logger.instance_variable_set(:@output_forced, false)
8079
Selenium::WebDriver.logger.output = io
8180

8281
begin
@@ -85,7 +84,6 @@ def capture_log_lines
8584
raise e, 'Can not evaluate output when statement raises an exception'
8685
ensure
8786
Selenium::WebDriver.logger.output = default_output
88-
Selenium::WebDriver.logger.instance_variable_set(:@output_forced, true) if output_forced
8987
end
9088

9189
io.rewind

0 commit comments

Comments
 (0)