p2p: Make timeout mockable and type safe, speed up test

This commit is contained in:
MarcoFalke
2020-07-10 18:19:11 +02:00
parent fa6d5a238d
commit fadc0c80ae
12 changed files with 62 additions and 54 deletions

View File

@ -378,10 +378,10 @@ def write_config(config_path, *, n, chain, extra_config="", disable_autoconnect=
f.write("fixedseeds=0\n")
f.write("listenonion=0\n")
# Increase peertimeout to avoid disconnects while using mocktime.
# peertimeout is measured in wall clock time, so setting it to the
# duration of the longest test is sufficient. It can be overridden in
# tests.
f.write("peertimeout=999999\n")
# peertimeout is measured in mock time, so setting it large enough to
# cover any duration in mock time is sufficient. It can be overridden
# in tests.
f.write("peertimeout=999999999\n")
f.write("printtoconsole=0\n")
f.write("upnp=0\n")
f.write("natpmp=0\n")