Skip to content

Commit be24b04

Browse files
committed
Relaxed timeouts to fix test flakiness
1 parent 8113506 commit be24b04

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎tests/streams/test_tls.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def serve_sync() -> None:
114114
nonlocal server_exc
115115
conn, addr = server_sock.accept()
116116
try:
117-
conn.settimeout(1)
117+
conn.settimeout(5)
118118
except BaseException as exc:
119119
server_exc = exc
120120
finally:
@@ -123,7 +123,7 @@ def serve_sync() -> None:
123123
server_sock = server_context.wrap_socket(
124124
socket.socket(), server_side=True, suppress_ragged_eofs=True
125125
)
126-
server_sock.settimeout(1)
126+
server_sock.settimeout(5)
127127
server_sock.bind(("127.0.0.1", 0))
128128
server_sock.listen()
129129
server_thread = Thread(target=serve_sync, daemon=True)

‎tests/test_from_thread.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,7 @@ def sync_thread() -> None:
788788
fs = [portal.start_task_soon(sleep, math.inf)]
789789
from_thread.run_sync(event.set)
790790
done, not_done = futures.wait(
791-
fs, timeout=1, return_when=futures.FIRST_COMPLETED
791+
fs, timeout=5, return_when=futures.FIRST_COMPLETED
792792
)
793793
assert not not_done
794794

‎tests/test_synchronization.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ async def test_cancel_after_release(self) -> None:
207207
statistics = lock.statistics()
208208
assert statistics.owner
209209
assert statistics.owner.name == "task1"
210-
await asyncio.wait([task1], timeout=1)
210+
await asyncio.wait([task1], timeout=5)
211211

212212
# The acquire() method should've released the semaphore because acquisition
213213
# failed due to cancellation
@@ -667,7 +667,7 @@ async def test_cancel_after_release(self) -> None:
667667
semaphore.release()
668668
task1.cancel()
669669
assert semaphore.value == 0
670-
await asyncio.wait([task1], timeout=1)
670+
await asyncio.wait([task1], timeout=5)
671671

672672
# The acquire() method should've released the semaphore because acquisition
673673
# failed due to cancellation

0 commit comments

Comments
 (0)