Files
palladum-lightning/tests
Rusty Russell 10eb2c2ca0 pytest: fix timeout flake in test_dataloss_protection
This test restarts l2 twice.  Each time, l1 is reconnecting, and backs
off.  If the test is slow enough, the backoff gets extreme:

```
2026-02-19T02:13:03.7669982Z lightningd-1 2026-02-19T01:50:56.541Z DEBUG   033845802d25b4e074ccfd7cd8b339a41dc75bf9978a034800444b51d42b07799a-lightningd: peer_disconnected
2026-02-19T02:13:03.7670444Z lightningd-1 2026-02-19T01:50:56.547Z DEBUG   033845802d25b4e074ccfd7cd8b339a41dc75bf9978a034800444b51d42b07799a-connectd: Will try reconnect in 256 seconds
```

This isn't a bug!  The backoff caps at 300 seconds, and only gets
reset if we remain connected for that long.

A manual reconnect here not only fixes the flake, but make the test
much faster, by not *doubling* the time for slow tests as shown on my
laptop (the final test using `taskset -c 1`):

           Normal      Valgrind      Valgrind, 1 CPU
Before:     22sec        124sec               230sec
After:      18sec        102sec               191sec

These are from a single run: it could be much more in the worst case.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2026-02-20 10:47:10 +10:30
..
2026-02-09 14:48:15 +10:30