From 9fa65d7621853b24b7fb13acd44fedb28543b261 Mon Sep 17 00:00:00 2001 From: Tom Clegg Date: Thu, 14 Feb 2019 02:07:21 -0500 Subject: [PATCH] 14845: Fix inconsistent timeout error message. http.Client's Timeout feature is not needed because every outgoing request runs in the context of an incoming request, which already has a deadline. It only makes the "timed out" error response inconsistent. Arvados-DCO-1.1-Signed-off-by: Tom Clegg --- lib/controller/federation_test.go | 24 ++++++++++++++---------- lib/controller/handler.go | 2 -- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/lib/controller/federation_test.go b/lib/controller/federation_test.go index c935e20be6..d49d16a35e 100644 --- a/lib/controller/federation_test.go +++ b/lib/controller/federation_test.go @@ -555,16 +555,20 @@ func (s *FederationSuite) TestGetRemoteContainerRequest(c *check.C) { func (s *FederationSuite) TestUpdateRemoteContainerRequest(c *check.C) { defer s.localServiceReturns404(c).Close() - req := httptest.NewRequest("PATCH", "/arvados/v1/container_requests/"+arvadostest.QueuedContainerRequestUUID, - strings.NewReader(`{"container_request": {"priority": 696}}`)) - req.Header.Set("Authorization", "Bearer "+arvadostest.ActiveToken) - req.Header.Set("Content-type", "application/json") - resp := s.testRequest(req) - c.Check(resp.StatusCode, check.Equals, http.StatusOK) - var cr arvados.ContainerRequest - c.Check(json.NewDecoder(resp.Body).Decode(&cr), check.IsNil) - c.Check(cr.UUID, check.Equals, arvadostest.QueuedContainerRequestUUID) - c.Check(cr.Priority, check.Equals, 696) + setPri := func(pri int) { + req := httptest.NewRequest("PATCH", "/arvados/v1/container_requests/"+arvadostest.QueuedContainerRequestUUID, + strings.NewReader(fmt.Sprintf(`{"container_request": {"priority": %d}}`, pri))) + req.Header.Set("Authorization", "Bearer "+arvadostest.ActiveToken) + req.Header.Set("Content-type", "application/json") + resp := s.testRequest(req) + c.Check(resp.StatusCode, check.Equals, http.StatusOK) + var cr arvados.ContainerRequest + c.Check(json.NewDecoder(resp.Body).Decode(&cr), check.IsNil) + c.Check(cr.UUID, check.Equals, arvadostest.QueuedContainerRequestUUID) + c.Check(cr.Priority, check.Equals, pri) + } + setPri(696) + setPri(1) // Reset fixture so side effect doesn't break other tests. } func (s *FederationSuite) TestCreateRemoteContainerRequest(c *check.C) { diff --git a/lib/controller/handler.go b/lib/controller/handler.go index 295dde7ca4..53125ae554 100644 --- a/lib/controller/handler.go +++ b/lib/controller/handler.go @@ -80,12 +80,10 @@ func (h *Handler) setup() { h.handlerStack = mux sc := *arvados.DefaultSecureClient - sc.Timeout = time.Duration(h.Cluster.HTTPRequestTimeout) sc.CheckRedirect = neverRedirect h.secureClient = &sc ic := *arvados.InsecureHTTPClient - ic.Timeout = time.Duration(h.Cluster.HTTPRequestTimeout) ic.CheckRedirect = neverRedirect h.insecureClient = &ic -- 2.30.2