From 98280a9b07a4d3c6981608f1b43d4f2ff29ec74e Mon Sep 17 00:00:00 2001 From: Giampaolo Rodola Date: Tue, 10 Dec 2019 16:26:25 +0800 Subject: [PATCH 1/2] increment large sendfile() test timeout --- Lib/test/test_largefile.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_largefile.py b/Lib/test/test_largefile.py index 6c8813e062602ed..1862412278f0a5b 100644 --- a/Lib/test/test_largefile.py +++ b/Lib/test/test_largefile.py @@ -168,7 +168,7 @@ def test_it(self): @unittest.skipIf(not hasattr(os, 'sendfile'), 'sendfile not supported') class TestSocketSendfile(LargeFileTest, unittest.TestCase): open = staticmethod(io.open) - timeout = 3 + timeout = 20 def setUp(self): super().setUp() @@ -184,6 +184,7 @@ def tcp_server(self, sock): def run(sock): with sock: conn, _ = sock.accept() + conn.settimeout(self.timeout) with conn, open(TESTFN2, 'wb') as f: event.wait(self.timeout) while True: From 123b8c41e7e114f287fd39cffdafb1894300d37b Mon Sep 17 00:00:00 2001 From: Giampaolo Rodola Date: Tue, 10 Dec 2019 16:50:00 +0800 Subject: [PATCH 2/2] use support.SHORT_TIMEOUT --- Lib/test/test_largefile.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_largefile.py b/Lib/test/test_largefile.py index 1862412278f0a5b..e309282d73e2a6e 100644 --- a/Lib/test/test_largefile.py +++ b/Lib/test/test_largefile.py @@ -9,6 +9,7 @@ import shutil import threading from test.support import TESTFN, requires, unlink, bigmemtest, find_unused_port +from test.support import SHORT_TIMEOUT import io # C implementation of io import _pyio as pyio # Python implementation of io @@ -168,7 +169,7 @@ def test_it(self): @unittest.skipIf(not hasattr(os, 'sendfile'), 'sendfile not supported') class TestSocketSendfile(LargeFileTest, unittest.TestCase): open = staticmethod(io.open) - timeout = 20 + timeout = SHORT_TIMEOUT def setUp(self): super().setUp()