Skip to content

Commit 6ad1730

Browse files
committed
rfac: change conn to http from tcp in long_conn e2e test and added delay btw requests
Signed-off-by: Yash Patel <[email protected]>
1 parent 7a2cf8d commit 6ad1730

File tree

2 files changed

+26
-21
lines changed

2 files changed

+26
-21
lines changed

test/e2e/baseline_test.go

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -827,35 +827,41 @@ func TestLongConnL4Telemetry(t *testing.T) {
827827
localDst := dst
828828
localSrc := src
829829
opt := echo.CallOptions{
830-
Port: echo.Port{Name: "tcp"},
831-
Scheme: scheme.TCP,
832-
Count: 10,
833-
Timeout: time.Second,
830+
Port: echo.Port{Name: "http"},
831+
Scheme: scheme.HTTP,
832+
Count: 20,
833+
Timeout: 5 * time.Second,
834834
Check: check.OK(),
835+
HTTP: echo.HTTP{Path: "/?delay=3s"},
835836
To: localDst,
836837
NewConnectionPerRequest: false,
837838
}
838839

840+
stc.Logf("sending continous calls from %q to %q", deployName(localSrc), localDst.Config().Service)
841+
go localSrc.CallOrFail(stc, opt)
842+
839843
query := buildL4Query(localSrc, localDst, "kmesh_tcp_sent_bytes_total")
840844
stc.Logf("prometheus query: %#v", query)
841-
err := retry.Until(func() bool {
842-
stc.Logf("sending call from %q to %q", deployName(localSrc), localDst.Config().Service)
843-
localSrc.CallOrFail(stc, opt)
844-
reqs, err := prom.QuerySum(localSrc.Config().Cluster, query)
845+
for i := 0; i < 2; i++ {
846+
err := retry.Until(func() bool {
847+
reqs, err := prom.QuerySum(localSrc.Config().Cluster, query)
848+
if err != nil {
849+
stc.Logf("could not query for traffic from %q to %q: %v", deployName(localSrc), localDst.Config().Service, err)
850+
return false
851+
}
852+
if reqs == 0.0 {
853+
stc.Logf("found zero-valued sum for traffic from %q to %q: %v", deployName(localSrc), localDst.Config().Service, err)
854+
return false
855+
}
856+
return true
857+
}, retry.Timeout(15*time.Second), retry.BackoffDelay(1*time.Second))
845858
if err != nil {
846-
stc.Logf("could not query for traffic from %q to %q: %v", deployName(localSrc), localDst.Config().Service, err)
847-
return false
859+
PromDiff(t, prom, localSrc.Config().Cluster, query)
860+
stc.Errorf("could not validate L4 telemetry for %q to %q: %v", deployName(localSrc), localDst.Config().Service, err)
848861
}
849-
if reqs == 0.0 {
850-
stc.Logf("found zero-valued sum for traffic from %q to %q: %v", deployName(localSrc), localDst.Config().Service, err)
851-
return false
852-
}
853-
return true
854-
}, retry.Timeout(15*time.Second), retry.BackoffDelay(1*time.Second))
855-
if err != nil {
856-
PromDiff(t, prom, localSrc.Config().Cluster, query)
857-
stc.Errorf("could not validate L4 telemetry for %q to %q: %v", deployName(localSrc), localDst.Config().Service, err)
862+
time.Sleep(5 * time.Second)
858863
}
864+
time.Sleep(60 * time.Second)
859865
})
860866
}
861867
}

test/e2e/run_test.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,5 +298,4 @@ if [[ -n "${CLEANUP_REGISTRY}" ]]; then
298298
cleanup_docker_registry
299299
fi
300300

301-
rm -rf "${TMP}"
302-
301+
rm -rf "${TMP}"

0 commit comments

Comments
 (0)