Skip to content

Commit ea97c18

Browse files
authored
Merge pull request #804 from minrk/update-mac
make wait_for_send more reliable
2 parents 2aefd10 + 1cdd811 commit ea97c18

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
- python: "3.8"
4747
runs_on: windows-2019
4848
- python: "3.9"
49-
runs_on: macos-10.15
49+
runs_on: macos-11
5050
- python: "3.11"
5151

5252
steps:

ipyparallel/tests/test_asyncresult.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,13 +395,16 @@ def test_dir(self):
395395
def test_wait_for_send(self):
396396
view = self.client[-1]
397397
view.track = True
398+
398399
with pytest.raises(TimeoutError):
399400
# this test can fail if the send happens too quickly
400401
# e.g. the IO thread takes control for too long,
401402
# so run the test a few times
402-
for i in range(10):
403+
for i in range(3):
403404
if i > 0:
404405
print("Retrying test_wait_for_send")
406+
# inject delay in io loop so send doesn't complete immediately
407+
self.client._io_loop.add_callback(lambda: time.sleep(0.5))
405408
data = os.urandom(10 * 1024 * 1024)
406409
ar = view.apply_async(lambda x: x, data)
407410
ar.wait_for_send(0)

0 commit comments

Comments
 (0)