[arvados] updated: 2.1.0-2619-g8d6c35e4d

git repository hosting git at public.arvados.org
Fri Jun 24 18:08:59 UTC 2022


Summary of changes:
 sdk/go/httpserver/inspect_test.go | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

       via  8d6c35e4dd68baec1b58d566d32d89feb651deac (commit)
      from  13ea738547ce7232c152873970770c21e97d2830 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 8d6c35e4dd68baec1b58d566d32d89feb651deac
Author: Tom Clegg <tom at curii.com>
Date:   Fri Jun 24 14:08:34 2022 -0400

    19205: Fix flaky test.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>

diff --git a/sdk/go/httpserver/inspect_test.go b/sdk/go/httpserver/inspect_test.go
index cab8a434d..624cedb3b 100644
--- a/sdk/go/httpserver/inspect_test.go
+++ b/sdk/go/httpserver/inspect_test.go
@@ -9,6 +9,8 @@ import (
 	"encoding/json"
 	"net/http"
 	"net/http/httptest"
+	"strings"
+	"time"
 
 	"github.com/prometheus/client_golang/prometheus"
 	"github.com/prometheus/client_golang/prometheus/promhttp"
@@ -60,10 +62,17 @@ func (s *Suite) TestInspect(c *check.C) {
 	reqcancel()
 
 	// Request context is canceled but handler hasn't returned, so
-	// we should see max abandoned request age > 0
-	resp = httptest.NewRecorder()
-	promhttp.HandlerFor(reg, promhttp.HandlerOpts{}).ServeHTTP(resp, mreq)
-	c.Check(resp.Code, check.Equals, http.StatusOK)
+	// we should see max abandoned request age > 0 and active ==
+	// 0. We might need to wait a short time for the cancel to
+	// propagate.
+	for deadline := time.Now().Add(time.Second); time.Now().Before(deadline); time.Sleep(time.Second / 100) {
+		resp = httptest.NewRecorder()
+		promhttp.HandlerFor(reg, promhttp.HandlerOpts{}).ServeHTTP(resp, mreq)
+		c.Assert(resp.Code, check.Equals, http.StatusOK)
+		if strings.Contains(resp.Body.String(), "\narvados_max_active_request_age_seconds 0\n") {
+			break
+		}
+	}
 	c.Check(resp.Body.String(), check.Matches, `(?ms).*\narvados_max_active_request_age_seconds 0\n.*`)
 	c.Check(resp.Body.String(), check.Matches, `(?ms).*\narvados_max_abandoned_request_age_seconds [0\.]*[1-9][-\d\.e]*\n.*`)
 

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list