pytest: wait for stderr, rather than asserting.

Two almost identical assertion fails under CI.  Try waiting.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2022-06-26 14:06:01 +09:30
parent 2f27aad8d0
commit c1a111b68c
2 changed files with 2 additions and 2 deletions

View File

@@ -244,7 +244,7 @@ def test_only_announce_one_dns(node_factory, bitcoind):
# and test that we can't announce more than one DNS address # and test that we can't announce more than one DNS address
l1 = node_factory.get_node(may_fail=True, expect_fail=True, l1 = node_factory.get_node(may_fail=True, expect_fail=True,
options={'announce-addr': ['localhost.localdomain:12345', 'example.com:12345']}) options={'announce-addr': ['localhost.localdomain:12345', 'example.com:12345']})
assert l1.daemon.is_in_stderr("Only one DNS can be announced") wait_for(lambda: l1.daemon.is_in_stderr("Only one DNS can be announced"))
@pytest.mark.developer("needs DEVELOPER=1") @pytest.mark.developer("needs DEVELOPER=1")

View File

@@ -95,7 +95,7 @@ def test_option_types(node_factory):
# the node should fail to start, and we get a stderr msg # the node should fail to start, and we get a stderr msg
assert not n.daemon.running assert not n.daemon.running
assert n.daemon.is_in_stderr('bool_opt: ! does not parse as type bool') wait_for(lambda: n.daemon.is_in_stderr('bool_opt: ! does not parse as type bool'))
# What happens if we give it a bad int-option? # What happens if we give it a bad int-option?
n = node_factory.get_node(options={ n = node_factory.get_node(options={