test: add TLS performance matrix

This commit is contained in:
2026-09-21 05:13:51 +08:00
parent 847621d218
commit e6c82a01fe
5 changed files with 133 additions and 15 deletions

View File

@@ -45,6 +45,18 @@ func TestExchangeRejectsInvalidResponses(t *testing.T) {
}
}
func TestExchangeModeTLS(t *testing.T) {
server := httptest.NewTLSServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("X-Request-ID", "perfCheck")
w.WriteHeader(http.StatusOK)
_, _ = w.Write([]byte(expectedBody))
}))
defer server.Close()
if err := exchangeMode(server.Client(), strings.TrimPrefix(server.URL, "https://"), true); err != nil {
t.Fatal(err)
}
}
func TestPercentileBounds(t *testing.T) {
var h histogram
// Known ranks, including a tail much slower than the median.