Skip to content

fix(tests): close the UDP, DNS and git gaps of the network floor - #5101

Merged
dan-petty merged 2 commits into
mainfrom
fix/4711-network-floor-udp-dns-git
Nov 12, 2026
Merged

dan-petty merged 2 commits into
mainfrom
fix/4711-network-floor-udp-dns-git

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

The network block of the test floor patched only connect, bind, listen and getaddrinfo. A UDP datagram, a lookup through the other name functions of socket, and a real git child with an https or ssh remote got out of a test.

The block now also guards sendto and sendmsg for a host that is not loopback, and gethostbyname, gethostbyname_ex, gethostbyaddr and getnameinfo for a lookup that needs a DNS query. The floor records each reach, so the test fails with network edge reached without a fake also when the code catches the error. A loopback UDP server still works.

The .gitconfig of the isolated HOME sets protocol.allow = never and protocol.file.allow = user, the transport policy of git itself. A real git child refuses each remote but a local one at once. GIT_ALLOW_PROTOCOL cannot do this, because build_subprocess_env removes it.

Closes #4711

Change: openspec/changes/archive/2026-11-12-4711-close-the-udp-dns-and-git/

The network block of the test floor now refuses a datagram that sendto or
sendmsg sends to a host that is not loopback, and each lookup of
gethostbyname, gethostbyname_ex, gethostbyaddr and getnameinfo that needs a
DNS query. The floor records each reach, so the test fails also when the code
catches the error. The git config of the isolated HOME sets
protocol.allow=never and protocol.file.allow=user, so a real git child
refuses an https, ssh or git remote at once.

Closes #4711
@dan-petty dan-petty added type/bug Type bug: the code does not do what it must scope/tests The test suite, its fixtures, fakes and floor labels Nov 12, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Proof on the base

uv run devops ci fail-to-pass --base origin/main exits 1 with 0 failed on base (0 failed and 31 passed in tests/invariants/test_hermetic_floor.py; 0 errored). The replay puts the whole tests/ tree of the head on the base, and this fix is in tests/conftest.py and tests/support/bootstrap.py, so the base run gets the fix too. This is #4908 (comment added there). The Fail-to-Pass workflow does not run for this pull request, because it changes no file under src/.

The base tree with only the changed test file of the head:

git worktree add --detach <tmp> origin/main          # 8a7b1137e
git -C <tmp> checkout <head> -- tests/invariants/test_hermetic_floor.py
uv run pytest -p no:randomly -n 0 tests/invariants/test_hermetic_floor.py -k "udp or git_refuses or numeric_lookups"

Result: 2 failed, 1 passed.

  • test_caught_udp_sends_and_name_lookups_fail_with_edge_name: the six caught probes give 6 passed and 0 errors on the base (expected 6 errors).
  • test_git_refuses_a_network_remote_at_once: on the base, git reaches the remote: fatal: repository 'https://example.com/example/repo.git/' not found.
  • test_loopback_udp_and_numeric_lookups_pass passes on the base and on the head.

Checks run locally

  • uv run devops ci test (full suite, head before the rebase): 3 failed, 23830 passed, 2 skipped in 458 s. The 3 failures are the review_window transcript cases of fix(roadmap): the review_window git transcript does not match the code #4865 (test_git_contract.py x2, test_review_facts.py::test_the_facts_of_a_version_window). They also fail on origin/main with no change.
  • uv run devops ci --check --only lint,format,docs,constructs,test-tree,swallowed-failures: all pass.
  • uv run devops ci test tests/invariants/test_hermetic_floor.py: 31 passed.

Measurements

  • Before: 3 egress paths open (UDP send, the 4 other lookups of socket, git network transports). After: 0.
  • Test time: the 3 new tests add about 1.5 s of serial time (the pytester run of the six probes and two git children). No CI job or runner-minute change.

@dan-petty
dan-petty marked this pull request as ready for review November 12, 2026 14:20
@dan-petty
dan-petty merged commit 047ee48 into main Nov 12, 2026
23 checks passed
@dan-petty
dan-petty deleted the fix/4711-network-floor-udp-dns-git branch November 12, 2026 14:21
dan-petty pushed a commit that referenced this pull request Nov 12, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.119.0](v0.118.0...v0.119.0)
(2026-11-12)


### Features

* **repos:** the claim sets In Progress
([#5111](#5111))
([06ef1c6](06ef1c6))
* **roadmap:** a fix-plan step repairs a plan PR with open findings
([#5104](#5104))
([ca5b16d](ca5b16d))
* **roadmap:** extend stage review rounds while open findings drop
([#5090](#5090))
([bacf713](bacf713))
* **roadmap:** re-anchor a stale citation that matches one line
([#5040](#5040))
([16356d8](16356d8))


### Bug Fixes

* **ci:** keep failed test IDs in the service image shard summary
([#5106](#5106))
([88589ef](88589ef))
* **github:** count each page of a paginated GitHub read
([#5070](#5070))
([908e24a](908e24a))
* **github:** keep the metrics permissions out of the runner Job token
([#5064](#5064))
([fb549ff](fb549ff))
* **github:** pace mutations through the clock seam
([#5063](#5063))
([2bd87bc](2bd87bc))
* **k8s:** delete the CoreDNS files that k3s never applies
([#5055](#5055))
([463f601](463f601))
* **monitoring:** tidy LLM stack windows, units and lines
([#5052](#5052))
([375d724](375d724))
* **roadmap:** a refused kept plan uses no stage gate return
([#4983](#4983))
([b8adbca](b8adbca))
* **roadmap:** count a command as removed only when MUST NOT governs it
([#4985](#4985))
([2e6f407](2e6f407))
* **roadmap:** cut prose after a cited stage command
([#4982](#4982))
([a172563](a172563))
* **roadmap:** name every module of a group with no named test
([#5089](#5089))
([27a0e79](27a0e79))
* **roadmap:** stage returns every open review finding to the planner
([#5067](#5067))
([21b116e](21b116e))
* **roadmap:** the alternatives check reads the tools in use
([#5062](#5062))
([8903233](8903233))
* **roadmap:** the constants gate reads 6_500 and no new value
([#5080](#5080))
([8a7b113](8a7b113))
* **roadmap:** the constants gate reads only a stated value
([#5042](#5042))
([cf4733e](cf4733e))
* **telemetry:** read repository traffic as the GitHub App
([#4932](#4932))
([7c42823](7c42823))
* **tests:** close the UDP, DNS and git gaps of the network floor
([#5101](#5101))
([047ee48](047ee48))
* **tests:** repair the bwrap contract suite and gate it
([#5110](#5110))
([9a0659d](9a0659d)),
closes [#4715](#4715)


### Performance Improvements

* **ci:** build the Service image once for its test shards
([#5079](#5079))
([dcf5bd5](dcf5bd5))
* **ci:** run only the required checks on the release PR
([#5057](#5057))
([8174071](8174071))
* **ci:** stop the cache export of pull request image builds
([#5113](#5113))
([ba30820](ba30820))
* **roadmap:** consolidate keeps its vectors in the shared tiers
([#5099](#5099))
([2a8bf1a](2a8bf1a))


### Code Refactoring

* **roadmap:** one Status writer for every job
([#5109](#5109))
([24cfedc](24cfedc))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/tests The test suite, its fixtures, fakes and floor type/bug Type bug: the code does not do what it must

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(tests): close the UDP, DNS and git gaps of the network floor

1 participant