Skip to content

Commit 0258924

Browse files
authored
Make HTTP fetch test more reliable (#1512)
Since the update of Xcode, some of HTTP tests are failing on macOS, due to `reqests.get` fails to establish a connection to local server. This change increase the wait time to 2 seconds before test starts.
1 parent 7078fcd commit 0258924

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/torchaudio_unittest/common_utils/case_utils.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,9 @@ def setUpClass(cls):
5959
super().setUpClass()
6060
cls._proc = subprocess.Popen(
6161
['python', '-m', 'http.server', f'{cls._port}'],
62-
cwd=cls.get_base_temp_dir())
63-
time.sleep(1.0)
62+
cwd=cls.get_base_temp_dir(),
63+
stderr=subprocess.DEVNULL) # Disable server-side error log because it is confusing
64+
time.sleep(2.0)
6465

6566
@classmethod
6667
def tearDownClass(cls):

0 commit comments

Comments
 (0)