Skip to content

Commit

Permalink
pytest: fix test_commando_stress
Browse files Browse the repository at this point in the history
On fast machines, we don't get failures sometimes on commando commands.

(*But* we still got "New cmd replacing old" messages, which is how I
realized we weren't freeing them promptly, hence the previous fix).

```
        # Should have exactly one discard msg from each discard
>       nodes[0].daemon.wait_for_logs([r"New cmd from .*, replacing old"] * discards)

tests/test_plugin.py:2839: 
...
>                   raise TimeoutError('Unable to find "{}" in logs.'.format(exs))
E                   TimeoutError: Unable to find "[]" in logs.

```

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  • Loading branch information
rustyrussell committed Jul 26, 2022
1 parent e158ce1 commit fb22f3b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/test_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2835,8 +2835,12 @@ def test_commando_stress(node_factory, executor):
assert(e.error['message'] == "Invalid JSON")
discards += 1

# Should have exactly one discard msg from each discard
nodes[0].daemon.wait_for_logs([r"New cmd from .*, replacing old"] * discards)
# Should have at least one discard msg from each failure (we can have
# more, if they kept replacing each other, as happens!)
if discards > 0:
nodes[0].daemon.wait_for_logs([r"New cmd from .*, replacing old"] * discards)
else:
assert not nodes[0].daemon.is_in_log(r"New cmd from .*, replacing old")


def test_commando_badrune(node_factory):
Expand Down

0 comments on commit fb22f3b

Please sign in to comment.