Tests no longer connect to test servers they closed (closes #257)
check / check (push) Successful in 5m12s
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:
1 parent
3a37f82e34
commit
230248d058
3 files changed
+24
-12
No files matched your search
@@ -153,14 +153,10 @@ func TestUnsetRouteWatchChangesNothing(t *testing.T) {
|
||||
func TestUnreachableRouteWatchLetsTheRequestThroughAndSaysWhy(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
// A stand-in that is closed at once, so that the port refuses connections.
|
||||
dead := httptest.NewServer(http.NotFoundHandler())
|
||||
url := dead.URL
|
||||
|
||||
dead.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.
|
||||
s, _, _ := startWithClock(t, "", map[string]string{
|
||||
lookupSource: off, routeWatchURL: url,
|
||||
lookupSource: off, routeWatchURL: "http://224.0.0.1",
|
||||
})
|
||||
|
||||
wantTagsMissing(t, s.get(fromDE, http.StatusOK, requestlog.ActionForward),
|
||||
|
||||
Reference in new issue
Block a user