Testcontainers reports the container host as `localhost`, which resolves to ::1 before 127.0.0.1 on this machine. Docker publishes the mapped port on IPv4 only, and the IPv6 SYN is dropped rather than refused, so asyncpg blocked on the first address until its connect timeout instead of falling back to the second -- the migration fixture hung rather than failing. 127.0.0.1 connects in 0.07s where localhost timed out at 15s; the integration suite now runs in 3.6s, inside the 10s pytest-timeout.
3.0 KiB
3.0 KiB