Tests no longer connect to test servers they closed (closes #257)
check / check (push) Successful in 5m12s

Three tests closed a test server and then connected to its port. Another
test process could take that port in between and receive the connection.

- TestUnreachableRouteWatchLetsTheRequestThroughAndSaysWhy and
  TestUnreachableRoutewatchFailsTheQueryAndTheLogOmitsTheClient, formerly
  TestRefusedConnection..., point routewatch at 224.0.0.1, a multicast
  address to which TCP cannot connect.
- TestStalledRemoteLogEndpointHoldsUpNoRequest keeps its endpoint open
  and closes each connection it takes, instead of closing the endpoint.

No change to non-test code.

Model: opus-5-5
This commit is contained in:
sneak committed 2026-11-09 22:19:41 +00:00
1 parent 3a37f82e34
commit 230248d058
3 files changed
+24 -12

No files matched your search

+7 -2
View File
@@ -239,12 +239,17 @@ func TestAnswerRoutewatchCannotBeTakenFromFails(t *testing.T) {
}
}
func TestRefusedConnectionFailsTheQueryAndTheLogOmitsTheClient(t *testing.T) {
func TestUnreachableRoutewatchFailsTheQueryAndTheLogOmitsTheClient(t *testing.T) {
t.Parallel()
f := newFixture(t, answering(routedAnswer))
f.server.Close()
// Another test can take a closed server's port at once, so routewatch's
// address here is a multicast address, to which TCP cannot connect.
f.client = routewatch.New(routewatch.Params{
URL: "http://224.0.0.1/", Now: f.clk.Now,
ProcessLog: slog.New(slog.NewTextHandler(f.log, nil)),
})
f.route()
f.waitFor(routewatch.RequestFailed)