Fix flaky host identity test. (#31446)

This commit is contained in:
Victor Lyuboslavsky 2025-07-31 19:49:02 +02:00 committed by GitHub
parent ba18664446
commit c7e17c8066
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -17,6 +17,7 @@ import (
"encoding/json"
"encoding/pem"
"fmt"
"io"
mathrand "math/rand/v2"
"net/http"
"os"
@ -267,7 +268,9 @@ func testOrbitEnrollment(t *testing.T, s *Suite, cert *x509.Certificate, eccPriv
err = signer.Sign(req)
require.NoError(t, err)
// Clone the request before sending it to preserve the body
clonedRequest := req.Clone(ctx)
clonedRequest.Body = io.NopCloser(bytes.NewReader(reqBody))
// Send the signed request
client := fleethttp.NewClient()