Skip to content

Commit

Permalink
Make HTTP fetch test more reliable (#1512)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mthrok committed May 19, 2021
1 parent 7078fcd commit 0258924
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/torchaudio_unittest/common_utils/case_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ def setUpClass(cls):
super().setUpClass()
cls._proc = subprocess.Popen(
['python', '-m', 'http.server', f'{cls._port}'],
cwd=cls.get_base_temp_dir())
time.sleep(1.0)
cwd=cls.get_base_temp_dir(),
stderr=subprocess.DEVNULL) # Disable server-side error log because it is confusing
time.sleep(2.0)

@classmethod
def tearDownClass(cls):
Expand Down

0 comments on commit 0258924

Please sign in to comment.