The tests in internal/lookup that have GeoJS asked now run in a testing/synctest bubble, as the state file tests do. Waits there run on the test's own clock, so TestNewClientWaitsAtMostOneSecondThenCountsAsNotFound checks a wait of exactly one second, and exactly none on the client's next request, however slowly the test process runs. The helpers that polled against real-time deadlines use synctest.Wait instead.
What the diff does not show:
A request waiting on the network keeps a bubble's clock from moving on, so the stand-in for GeoJS no longer listens on loopback: GeoJS's HTTP client calls its RoundTrip in place of the network. export_test.go, compiled only into the tests, lets them set that transport; the package's own code is unchanged.
How old an answer is, and how long GeoJS is left alone after a failure, still go by the test's testClock (GeoJS's Now); waits and request timeouts go by the bubble's clock.
Disclosures:
Judgement call: the tests that expect an answer within a client's one-second wait, and the test of the failure log, could also fail on a hold-up, so they run in bubbles too. The failure-log test now has its request go unanswered until it is abandoned, instead of asking a closed port on 127.0.0.1.
Model: opus-5-5
Fixes https://git.eeqj.de/sneak/smallwebwaf/issues/73.
The tests in `internal/lookup` that have GeoJS asked now run in a `testing/synctest` bubble, as the state file tests do. Waits there run on the test's own clock, so `TestNewClientWaitsAtMostOneSecondThenCountsAsNotFound` checks a wait of exactly one second, and exactly none on the client's next request, however slowly the test process runs. The helpers that polled against real-time deadlines use `synctest.Wait` instead.
What the diff does not show:
- A request waiting on the network keeps a bubble's clock from moving on, so the stand-in for GeoJS no longer listens on loopback: GeoJS's HTTP client calls its `RoundTrip` in place of the network. `export_test.go`, compiled only into the tests, lets them set that transport; the package's own code is unchanged.
- How old an answer is, and how long GeoJS is left alone after a failure, still go by the test's `testClock` (GeoJS's `Now`); waits and request timeouts go by the bubble's clock.
Disclosures:
- Judgement call: the tests that expect an answer within a client's one-second wait, and the test of the failure log, could also fail on a hold-up, so they run in bubbles too. The failure-log test now has its request go unanswered until it is abandoned, instead of asking a closed port on `127.0.0.1`.
Model: opus-5-5
The tests that have GeoJS asked now run in a synctest bubble, so a wait
lasts exactly as long as it should however slowly the test process runs:
a new client's wait is checked to be exactly one second, and its next
request exactly no wait. A request waiting on the network would stop the
bubble's clock, so the stand-in for GeoJS now answers in place of the
network, through a transport that a test-only file lets the tests set.
The test of the failure log uses an abandoned request instead of a
closed port.
Model: opus-5-5
Judgement call accepted: the tests that expect an answer within a client's one-second wait, and the failure-log test, also run on the test's own clock.
Judgement call accepted: the stand-in for GeoJS is set as the HTTP transport through export_test.go, which only the tests compile; the package's own code is unchanged.
Judgement call accepted: the failure-log test has its request go unanswered until it is abandoned, instead of asking a closed port.
Judgement call accepted: how old an answer is and how long GeoJS is left alone still go by testClock, while waits go by the synctest bubble's clock; the test file explains both.
Judgement call accepted: the tests name GeoJS's real URL; the stand-in answers in place of the network, so no request leaves the test.
Model: opus-5-5
Review passed.
- Judgement call accepted: the tests that expect an answer within a client's one-second wait, and the failure-log test, also run on the test's own clock.
- Judgement call accepted: the stand-in for GeoJS is set as the HTTP transport through `export_test.go`, which only the tests compile; the package's own code is unchanged.
- Judgement call accepted: the failure-log test has its request go unanswered until it is abandoned, instead of asking a closed port.
- Judgement call accepted: how old an answer is and how long GeoJS is left alone still go by `testClock`, while waits go by the synctest bubble's clock; the test file explains both.
- Judgement call accepted: the tests name GeoJS's real URL; the stand-in answers in place of the network, so no request leaves the test.
Model: opus-5-5
clawbot
merged commit 68f687cb0c into next2026-10-06 09:12:50 +02:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Fixes #73.
The tests in
internal/lookupthat have GeoJS asked now run in atesting/synctestbubble, as the state file tests do. Waits there run on the test's own clock, soTestNewClientWaitsAtMostOneSecondThenCountsAsNotFoundchecks a wait of exactly one second, and exactly none on the client's next request, however slowly the test process runs. The helpers that polled against real-time deadlines usesynctest.Waitinstead.What the diff does not show:
RoundTripin place of the network.export_test.go, compiled only into the tests, lets them set that transport; the package's own code is unchanged.testClock(GeoJS'sNow); waits and request timeouts go by the bubble's clock.Disclosures:
127.0.0.1.Model: opus-5-5
Review passed.
export_test.go, which only the tests compile; the package's own code is unchanged.testClock, while waits go by the synctest bubble's clock; the test file explains both.Model: opus-5-5