|
Meta tags:
description=gh-162606: Fix port races in asyncio connection-refused tests
test_create_connection_local_addr_skip_different_family and
test_sock_client_fail expected a connect to an unused port to be
refused, but the port was not reserved, so a parallel test could start
listening on it and the connect would succeed. Keep a bound,
non-listening socket open for the duration of each test instead.
Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com
gh-162606: Avoid find_unused_port() races in more asyncio tests
Bind servers to port 0 instead of picking a port first and binding it
later, retry test_create_connection_local_addr on EADDRINUSE, and keep
the port of test_open_connection_happy_eyeball_refcycles reserved on
both loopback addresses so the connection is reliably refused.
Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com
gh-162606: Remove unused import in test_proactor_events
Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com
gh-162606: Accept TimeoutError for non-listening ports on macOS
macOS and iOS fail a connect to a bound but non-listening port with
ETIMEDOUT immediately instead of ECONNREFUSED.
Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com
(cherry picked from commit 4b66b87)
Co-authored-by: Andrew Svetlov andrew.svetlov@gmail.com
Co-authored-by: Claude Opus 5.5 noreply@anthropic.com;
Headings (most frequently used words):
gh, uh, oh, navigation, 15, 162606, avoid, find_unused_port, races, in, asyncio, tests, 162607, 162619, footer, diff, view, menu, repository, there, are, no, files, selected, for, viewing, filter, by, extension,
Text of the page (most frequently used words):
self (75), file (43), port (40), loop (39), def (30), socket (30), socket_helper (27), srv_sock (22), line (21), sock (21), the (20), expand (20), that (19), test (19), await (19), hidden (18), characters (18), unicode (18), this (17), github (17), find_unused_port (16), and (16), server (15), show (15), bind (14), diff (14), test_asyncio (14), open (13), lib (13), asyncio (13), all (12), host (12), number (12), bidirectional (12), applied (11), lambda (11), async (11), for (11), changes (10), with (10), reload (9), getsockname (9), localhost (9), cannot (8), comments (8), from (8), down (8), run_loop (8), learn (8), about (8), view (8), close (8), handle_echo (8), client (8), address (8), getaddrinfo (8), you (7), suggestion (7), suggestions (7), while (7), change (7), code (7), loading (7), false (7), myproto (7), may (7), what (7), review (7), more (7), 127 (7), sign (7), can (6), proto (6), original (6), contains (6), text (6), interpreted (6), compiled (6), differently (6), than (6), appears (6), below (6), editor (6), reveals (6), desktop (6), delete (6), edit (6), deletions (6), run_until_complete (6), httpd (6), support (6), security (5), please (5), commit (5), there (5), make_socket (5), additions (5), none (5), messages (5), sock_stream (5), import (5), another (5), your (5), not (4), pull (4), was (4), error (4), page (4), sock_connect (4), create_server (4), try (4), reserved (4), append (4), sock4 (4), open_connection (4), addr (4), ctx (4), transport (4), assertraises (4), close_after (4), local_addr (4), create_connection (4), return (4), getaddrinfo_orig (4), args (4), kwargs (4), python (4), files (4), 162606 (4), avoid (4), races (4), tests (4), 162607 (4), copilot (4), community (3), navigation (3), 2026 (3), request (3), add (3), batch (3), closed (3), retry (3), cleanup (3), test_unix_events (3), oserror (3), sock6 (3), af_inet6 (3), hostv4 (3), connections (3), bound (3), but (3), listening (3), exception (3), reader (3), writer (3), wait_closed (3), assertequal (3), test_streams (3), connectionrefusederror (3), out (3), test_sock_lowlevel (3), af_inet (3), is_ssl (3), test_sendfile (3), test_proactor_events (3), port2 (3), cpython (3), test_events (3), hide (3), whitespace (3), filter (3), commits (3), 162619 (3), merged (3), account (3), quality (3), tab (3), window (3), refresh (3), session (3), developers (3), changelog (3), customer (3), enterprise (3), grade (3), features (3), build (3), contact (2), status (2), privacy (2), terms (2), footer (2), single (2), one (2), viewing (2), toggle (2), prepare (2), 512 (2), coro (2), main (2), hostv6 (2), except (2), keep (2), client_connected_cb (2), sockets (2), start_serving (2), start_server (2), raise (2), data (2), set_exception_handler (2), 1281 (2), timeouterror (2), setblocking (2), immediately (2), instead (2), are (2), macos (2), times (2), them (2), process (2), 530 (2), reduce_receive_buffer_size (2), srv_proto (2), ssl (2), srv_ctx (2), prepare_sendfile (2), sendfile (2), 308 (2), 176 (2), test_utils (2), proactor_events (2), skip_if_tcp_blackhole (2), port1 (2), see (2), issues (2), expected (2), errno (2), try_count (2), 794 (2), selected (2), apply (2), split (2), unified (2), failed (2), load (2), jump (2), extension (2), asvetlov (2), nov (2), tree (2), miss (2), islington (2), issue (2), insights (2), projects (2), actions (2), repository (2), signed (2), universe (2), training (2), integrations (2), stories (2), center (2), documentation (2), business (2), fixes (2), products (2), secret (2), perform, action, time, share, personal, information, manage, cookies, docs, inc, right, now, check, back, later, queued, merge, multi, pending, reviews, has, been, marked, resolved, outdated, must, existing, order, create, valid, applying, deleted, lines, supported, only, per, subset, invalid, because, were, made, annotations, notes, oops, something, went, wrong, exc, skiptest, ipv6_enabled, addcleanup, resolve, fail, both, loopback, addresses, test_open_connection_happy_eyeball_refcycles, unhandled, 1351, 1347, 1339, 1335, connection, read, timeout, reported, like, coroutine, case, raised, plain, function, test_unhandled_exception_sync_callback, 1321, 1319, drain, write, msg, _basetest_unhandled_exceptions, outer, listener, test_sock_accept, finally, take, refused, other, make, sure, will, get, unused, test_sock_client_fail, _basetest_sock_recv_into, test_unix_sock_client_ops, cli_ctx, 320, 319, mysendfileproto, note, via, equal, fallback, class, sendfilemixin, sendfilebase, prepare_socksendfile, reduce_send_buffer_size, 1071, 1070, utils, os_helper, _proactordatagramtransport, _proactorduplexpipetransport, addition, test_create_connection_local_addr_nomatch_family, could, grabbed, non, reserves, refuses, https, com, 86508, test_create_connection_local_addr_skip_different_family, get_extra_info, sockname, break, else, eaddrinuse, range, taken, before, run_test_server, test_create_connection_local_addr, test_create_ssl_unix_connection, conversations, clear, filters, viewed, type, nbsp, 90b507c, select, changed, checks, conversation, into, backport, 4b66b87, already, clicking, agree, our, occasionally, send, related, emails, statement, service, free, its, maintainers, have, question, project, new, items, requests, message, dismiss, alert, switched, accounts, appearance, settings, search, pricing, event, talks, workshops, next, partners, company, forum, events, webinars, blog, resource, connect, resources, premium, advanced, ons, trust, why, evaluate, industries, government, manufacturing, financial, services, healthcare, industry, nonprofits, startups, team, enterprises, stage, businesses, source, latest, improvements, across, place, developer, articles, sponsors, trending, repos, explore, customize, certifications, scanning, leak, prevention, protection, vulnerability, detection, remediation, secure, cloud, development, environments, codespaces, analysis, enforcement, automation, ship, coding, agent, tasks, automated, work, hosting, collaboration, platform, menu, skip, content,
|