提交 9ae81be0 编写于 作者: J Jon Leighton

Fix race condition in test

This should fix travis. For real this time! This is the one!

The readpartial(100) meant that an earlier assert_stdout could chomp up
the output that a later assert_stdout wants, meaning that the later
assertion fails.

Reading only 1 byte at a time ensure that we don't read any more than is
necessary to verify the assertion.
上级 ca35454b
......@@ -106,13 +106,13 @@ def teardown
teardown_app
end
def assert_output(expected, timeout = 5)
def assert_output(expected, timeout = 1)
timeout = Time.now + timeout
output = ""
until output.include?(expected) || Time.now > timeout
if IO.select([@master], [], [], 0.1)
output << @master.readpartial(100)
output << @master.read(1)
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册