From 9226994f3cc749599c70a704a298746909e9d718 Mon Sep 17 00:00:00 2001 From: "Huabing (Robin) Zhao" Date: Wed, 28 May 2025 01:36:22 +0000 Subject: [PATCH] fix flaky Signed-off-by: Huabing (Robin) Zhao --- test/e2e/tests/wasm_http.go | 10 +--------- test/e2e/tests/wasm_oci.go | 10 +--------- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/test/e2e/tests/wasm_http.go b/test/e2e/tests/wasm_http.go index 824e9b3d2f..d2c5e3d458 100644 --- a/test/e2e/tests/wasm_http.go +++ b/test/e2e/tests/wasm_http.go @@ -65,15 +65,7 @@ var HTTPWasmTest = suite.ConformanceTest{ Namespace: ns, } - req := http.MakeRequest(t, &expectedResponse, gwAddr, "HTTP", "http") - cReq, cResp, err := suite.RoundTripper.CaptureRoundTrip(req) - if err != nil { - t.Errorf("failed to get expected response: %v", err) - } - - if err := http.CompareRequest(t, &req, cReq, cResp, expectedResponse); err != nil { - t.Errorf("failed to compare request and response: %v", err) - } + http.MakeRequestAndExpectEventuallyConsistentResponse(t, suite.RoundTripper, suite.TimeoutConfig, gwAddr, expectedResponse) }) }, } diff --git a/test/e2e/tests/wasm_oci.go b/test/e2e/tests/wasm_oci.go index 93b2d13be9..211ae20781 100644 --- a/test/e2e/tests/wasm_oci.go +++ b/test/e2e/tests/wasm_oci.go @@ -161,15 +161,7 @@ var OCIWasmTest = suite.ConformanceTest{ Namespace: ns, } - req := http.MakeRequest(t, &expectedResponse, gwAddr, "HTTP", "http") - cReq, cResp, err := suite.RoundTripper.CaptureRoundTrip(req) - if err != nil { - t.Errorf("failed to get expected response: %v", err) - } - - if err := http.CompareRequest(t, &req, cReq, cResp, expectedResponse); err != nil { - t.Errorf("failed to compare request and response: %v", err) - } + http.MakeRequestAndExpectEventuallyConsistentResponse(t, suite.RoundTripper, suite.TimeoutConfig, gwAddr, expectedResponse) }) // Verify that the wasm module can't be loaded if the pull secret is missing