# HG changeset patch # User Pierre-Yves David # Date 1625930347 -7200 # Node ID 6bceecb28806b043a4b467f05440bc8b0cecf762 # Parent 28a914b3d4ceabb0434ecac03bc7487d2a50bcb8 windows: make sure we fully read and cleanly close the connection Maybe this will prevent server on Windows to sometimes complains about the client closing the connection too soon. So we make sure we read everything and we officially close the connection. Hopefully Windows will be happier and the test will stop being flaky. Differential Revision: https://phab.mercurial-scm.org/D11073 diff -r 28a914b3d4ce -r 6bceecb28806 tests/get-with-headers.py --- a/tests/get-with-headers.py Sat Jul 10 02:42:09 2021 +0200 +++ b/tests/get-with-headers.py Sat Jul 10 17:19:07 2021 +0200 @@ -84,7 +84,11 @@ b"%s: %s\n" % (h.encode('ascii'), response.getheader(h).encode('ascii')) ) - if not headeronly: + if headeronly: + # still read the body to prevent windows to be unhappy about that + # (this might some flakyness in test-hgweb-filelog.t on Windows) + data = response.read() + else: stdout.write(b'\n') data = response.read() @@ -112,6 +116,9 @@ if twice and response.getheader('ETag', None): tag = response.getheader('ETag') + # further try to please the windows-flakyness deity + conn.close() + return response.status