pytest: fix unexpected reconnection check in test_setconfig()

If we reconnect before the channel is completely closed, we might get
a "reconnected" message, so mine a block after and make sure it's
processed.

```
2023-06-20T11:37:56.1302058Z         if errors.has_errors():
2023-06-20T11:37:56.1302648Z             # Format a nice list of everything that went wrong and raise an exception
2023-06-20T11:37:56.1303781Z             request.node.has_errors = True
2023-06-20T11:37:56.1304091Z >           raise ValueError(str(errors))
2023-06-20T11:37:56.1304370Z E           ValueError: 
2023-06-20T11:37:56.1304624Z E           Node errors:
2023-06-20T11:37:56.1305042Z E            - lightningd-2: had unexpected reconnections
2023-06-20T11:37:56.1305340Z E           Global errors:
```
...
```
2023-06-20T11:37:56.1960525Z lightningd-2 2023-06-20T11:21:28.638Z DEBUG   0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518-chan#2: Peer has reconnected, state CLOSINGD_SIGEXCHANGE: connecting subd
```
This commit is contained in:
Rusty Russell 2023-06-21 09:17:11 +09:30
parent 263625872e
commit 35011337eb

View File

@ -3398,7 +3398,7 @@ def test_fast_shutdown(node_factory):
break
def test_setconfig(node_factory):
def test_setconfig(node_factory, bitcoind):
l1, l2 = node_factory.line_graph(2, fundchannel=False)
configfile = os.path.join(l2.daemon.opts.get("lightning-dir"), TEST_NETWORK, 'config')
@ -3436,7 +3436,10 @@ def test_setconfig(node_factory):
l1.fundchannel(l2, 400000)
l1.fundchannel(l2, 10**6)
l1.rpc.close(l2.info['id'])
txid = l1.rpc.close(l2.info['id'])['txid']
# Make sure we're completely closed!
bitcoind.generate_block(1, wait_for_mempool=txid)
sync_blockheight(bitcoind, [l1, l2])
# It's persistent!
l2.restart()