conftest.py checks every connect and every name lookup of the test process: loopback and local sockets pass, anything else is refused at once
(ConnectionRefusedError / gaierror, which the code under test reads as offline) and the test FAILS at its end, naming the host and the place in
the code the reach came from. A live test sets STRATA_TEST_ALLOW_NETWORK=1 itself (the live-download test class in tools/ does). Child
processes are not covered.
Three named allowances, counted per test and printed once at the end of the run ("network guard: allowances used": test id, allowance, address):
(a) a UDP connect() (it only names the peer and sends nothing), (b) a lookup of this computer's own host name, (c) the RFC 5737 documentation
addresses 192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24 (nothing answers them). tests/terminal/test_net_guard.py pins that an address outside
them, a real host name and a TCP connect outside those ranges still fail, and that each use is counted.
tests/terminal/test_owner_transport.py::TestLoopbackTransport::test_it_binds_loopback_only (a TCP connect to 203.0.113.1, on purpose) and
serve/test_security.py::ListenAddress::test_ipv6_loopback (a UDP connect to learn the outgoing address, and the computer's own name) pass through
allowances (c) and (a)/(b); those two tests are not changed.
Five tests of setup / launch / update looked up real host names and are fixed with a PC that has no name service (net_dead.no_name_resolution)
or, for setup.main's model-list read, STRATA_FEED_MODELS=0: tools/test_setup_unsloth.py::IQ4XS::test_family_default_and_menus,
tests/terminal/test_drafting_tuned.py::SetupOnAMac::test_offline_it_says_nothing, tests/terminal/test_update_notice.py::Offline (the DNS and the
proxy test), tests/tuning/test_components.py::TestInterruptedTransfer::test_a_partial_file_larger_than_the_declared_size_is_discarded.
Full check with the guard on (py-tools / py-tests / py-serve): p2006 (internet) 1713 / 3556 / 1495 passed, 0 failed; l620 (no internet)
1713 / 3556 / 1495 passed, 0 failed.
setup.py's size request (HEAD) for a download used to run 5 times with a 60 s limit and a 5 s sleep, silently: about 320 s per file, and
launch printed nothing meanwhile. Now every setup request on the download path goes through strata_control/netpolicy.py:
- the connection phase (lookup, connect, TLS, proxy CONNECT, the server's headers) gets 12 s, then one retry with 30 s, 2 s apart;
no lookup answer, a refused port, an unreachable network, a refused certificate and HTTP 4xx fail at once;
- after 5 s a line " Waiting for <host> to answer (<n> s so far) ..." is printed, then every 10 s;
- a host that failed after the whole window is not asked again for 10 minutes in the same process (memory only, never on disk);
- the failure names the host and says what to check and what still works offline (W3/W4/W5); the proxy and ModelScope hints follow.
Launch: the heartbeat also runs in the download phase, the waiting line becomes the status sentence (phase "waiting", W2), a new sentence is
always printed by the non-terminal printer (a second download's first figure was hidden), and a cancelled or stopped launch writes
"(you stopped it: <status>)" to the setup log. The app string "Waiting for {0} to answer ({1} s so far)" is added in nine languages
(translations are first drafts). conftest.py: every test starts with an empty host memory.
Tests: tests/terminal/test_netpolicy.py, test_net_launch_waits.py (local black hole, refusing port, a normal server), test_tls_trust.py,
test_no_acquisition.py, tools/test_setup_*.py (the fakes now patch the netpolicy.urlopen seam), apps/host/tests/net-waiting.test.mjs.
- the nvidia-smi stand-in fails as without a loaded driver, so the feed gate's own card stand-in comes first
- serve test_security: the IPv6 test skips when the box has no ::1 (Boston listens on :: but cannot reach ::1)
- tests/snapshot: setup's driver names a non-hybrid CPU (Boston's 8 P + 16 E cores added --pool-workers to 12 goldens)
- test_sycl_package / test_server GpuChoice: not the box's AMD cards (p2006's 780M in KFD)
- test_strata_mcp MacCatalog: the data folder under HOME on macOS, not the system temp folder
- test_bench_stop: a child collected between the signal and the /proc read is gone (1 in 15 on p2006); the pid is read whole
- ui-do.test.mjs reads the sources with CRLF turned into LF (an autocrlf checkout)
- conftest.py and the host test runner drop PowerShell 7's folders from PSModulePath, so the Windows PowerShell 5.1 children
that tests start (fetch-node.ps1, install.ps1, Get-Acl) can load their own modules
- tests/terminal draws the full look by default on Windows when no modern-terminal marker is set (STRATA_GLYPHS=unicode)
- PresetStore, bench_standard and the image-model rescan no longer depend on two events landing on different ~15.6 ms ticks
- test_runtime retries removing its temp folder while the stopped host lets go of its log