Skip to content

Commit

Permalink
pytest: fix flake in test_connection.py::test_opener_feerate_reconnect
Browse files Browse the repository at this point in the history
Make sure it sees disconnect before reconnect, otherwise the next command
fails since we're now disconnected.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  • Loading branch information
rustyrussell committed Mar 20, 2022
1 parent c5cbb71 commit 3b1d5a0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions lightningd/peer_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -1402,6 +1402,7 @@ void peer_disconnect_done(struct lightningd *ld, const u8 *msg)
/* If we still have peer, it's disconnected now */
p = peer_by_id(ld, &id);
if (p) {
log_peer_debug(ld->log, &id, "peer_disconnect_done");
p->is_connected = false;
/* If we only cared about peer because of connectd, free it. */
if (list_empty(&p->channels) && !p->uncommitted_channel) {
Expand Down
1 change: 1 addition & 0 deletions tests/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -2748,6 +2748,7 @@ def test_opener_feerate_reconnect(node_factory, bitcoind):

# Wait until they reconnect.
l1.daemon.wait_for_log('Peer transient failure in CHANNELD_NORMAL')
l1.daemon.wait_for_log('peer_disconnect_done')
wait_for(lambda: l1.rpc.getpeer(l2.info['id'])['connected'])

# Should work normally.
Expand Down

0 comments on commit 3b1d5a0

Please sign in to comment.