Tests no longer connect to test servers they closed (closes #257)
check / check (push) Failing after 3m59s

Four tests closed a test server or stopped discriminator, 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.
- TestTheSiteAnswersWhileDiscriminatorIsStoppedAndStartedAgain gives
  rproxy an address the test holds throughout. The test forwards each
  connection there to the running discriminator, and closes it while
  discriminator is stopped.

No change to non-test code.

Model: opus-5-5
This commit is contained in:
sneak committed 2026-11-09 23:27:10 +00:00
1 parent c86df7610d
commit 2dfd67b490
4 files changed
+120 -19

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)