test: Set allow_reuse_addr

This avoids intermittent "Address already in use" failure
This commit is contained in:
Matt Johnston 2022-03-15 15:38:46 +08:00
parent 488ffce133
commit ae8a0abc34

View File

@ -72,6 +72,10 @@ def own_venv_command():
return f"source {venv}/bin/activate"
class HandleTcp(socketserver.ThreadingMixIn, socketserver.TCPServer):
# override TCPServer's default, avoids TIME_WAIT
allow_reuse_addr = True
""" Listens for a single incoming request, sends a response if given,
and returns the inbound data.
Reponse can be a queue object, in which case each item in the queue will