1 Commits
Author SHA1 Message Date
sneak a96e54cd1a Tests no longer connect to test servers they closed (closes #257)
check / check (push) Successful in 4m29s
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
2026-11-09 23:04:10 +00:00
+6 -6
View File
@@ -280,16 +280,16 @@ func startForwarder(t *testing.T) (string, func(addr string)) {
})
var (
mu sync.Mutex
to string
lock sync.Mutex
to string
)
// dial connects to the address set, and returns nil while it is "". It
// holds the lock throughout, so once another address is set, nothing
// connects to the one before.
dial := func() net.Conn {
mu.Lock()
defer mu.Unlock()
lock.Lock()
defer lock.Unlock()
if to == "" {
return nil
@@ -323,8 +323,8 @@ func startForwarder(t *testing.T) (string, func(addr string)) {
}()
return listener.Addr().String(), func(addr string) {
mu.Lock()
defer mu.Unlock()
lock.Lock()
defer lock.Unlock()
to = addr
}