Improve reporting in #uhwm_wait_output cucumber helper
This commit is contained in:
parent
1079609cfc
commit
f66d8d24ee
@ -2,16 +2,17 @@ def uhwm_wait_output message, timeout: 1
|
|||||||
Timeout.timeout(timeout) do
|
Timeout.timeout(timeout) do
|
||||||
loop do
|
loop do
|
||||||
break if case message
|
break if case message
|
||||||
when Regexp
|
when Regexp then @process.read_stdout =~ message
|
||||||
@process.read_stdout =~ message
|
when String then assert_partial_output_interactive message
|
||||||
when String
|
|
||||||
assert_partial_output_interactive message
|
|
||||||
end
|
end
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
rescue Timeout::Error
|
rescue Timeout::Error
|
||||||
fail "expected message `#{message}' not seen after #{timeout} seconds"
|
fail [
|
||||||
|
"expected `#{message}' not seen after #{timeout} seconds in:",
|
||||||
|
"```\n#{@process.stdout + @process.stderr}```"
|
||||||
|
].join "\n"
|
||||||
end
|
end
|
||||||
|
|
||||||
Then /^the output must contain exactly the usage$/ do
|
Then /^the output must contain exactly the usage$/ do
|
||||||
|
Loading…
x
Reference in New Issue
Block a user