|
14 | 14 | import pytest
|
15 | 15 |
|
16 | 16 | from .. import _core, socket as tsocket
|
17 |
| -from .._core._tests.tutil import binds_ipv6, can_create_ipv6, creates_ipv6 |
| 17 | +from .._core._tests.tutil import binds_ipv6, can_create_ipv6, creates_ipv6, slow |
18 | 18 | from .._socket import _NUMERIC_ONLY, AddressFormat, SocketType, _SocketType, _try_sync
|
19 | 19 | from ..testing import assert_checkpoints, wait_all_tasks_blocked
|
20 | 20 |
|
@@ -829,6 +829,7 @@ async def t2() -> None:
|
829 | 829 |
|
830 | 830 |
|
831 | 831 | # This tests the complicated paths through connect
|
| 832 | +@slow |
832 | 833 | async def test_SocketType_connect_paths() -> None:
|
833 | 834 | with tsocket.socket() as sock:
|
834 | 835 | with pytest.raises(
|
@@ -895,17 +896,23 @@ def connect(
|
895 | 896 | # connect to fail. Really. Also if you use a non-routable
|
896 | 897 | # address. This way fails instantly though. As long as nothing
|
897 | 898 | # is listening on port 2.)
|
| 899 | + |
| 900 | + # Windows retries failed connections so this takes seconds |
| 901 | + # (and that's why this is marked @slow) |
898 | 902 | await sock.connect(("127.0.0.1", 2))
|
899 | 903 |
|
900 | 904 |
|
901 | 905 | # Fix issue #1810
|
| 906 | +@slow |
902 | 907 | async def test_address_in_socket_error() -> None:
|
903 | 908 | address = "127.0.0.1"
|
904 | 909 | with tsocket.socket() as sock:
|
905 | 910 | with pytest.raises(
|
906 | 911 | OSError,
|
907 | 912 | match=rf"^\[\w+ \d+\] Error connecting to \({address!r}, 2\): (Connection refused|Unknown error)$",
|
908 | 913 | ):
|
| 914 | + # Windows retries failed connections so this takes seconds |
| 915 | + # (and that's why this is marked @slow) |
909 | 916 | await sock.connect((address, 2))
|
910 | 917 |
|
911 | 918 |
|
@@ -1215,7 +1222,7 @@ async def receiver() -> None:
|
1215 | 1222 |
|
1216 | 1223 |
|
1217 | 1224 | async def test_many_sockets() -> None:
|
1218 |
| - total = 5000 # Must be more than MAX_AFD_GROUP_SIZE |
| 1225 | + total = 1000 # Must be more than MAX_AFD_GROUP_SIZE |
1219 | 1226 | sockets = []
|
1220 | 1227 | # Open at most <total> socket pairs
|
1221 | 1228 | for opened in range(0, total, 2):
|
|
0 commit comments