hs-test: PromMemLeakTest improvement 05/43505/1
authorMatus Fabian <[email protected]>
Fri, 1 Aug 2025 10:13:44 +0000 (06:13 -0400)
committerMatus Fabian <[email protected]>
Fri, 1 Aug 2025 10:13:44 +0000 (06:13 -0400)
do warmup with same nuber of requests and sleep before main test
section to prevent false positives

Type: test

Change-Id: Ie0ffbb27be58693f0c35c9a7ffed216ec4be1cb4
Signed-off-by: Matus Fabian <[email protected]>
extras/hs-test/http1_test.go

index 045109c..6e0f9d7 100644 (file)
@@ -904,8 +904,14 @@ func PromMemLeakTest(s *Http1Suite) {
        s.Log(vpp.Vppctl("prom enable"))
        time.Sleep(time.Second * 3)
 
-       /* warmup request (FIB) */
-       promReq(s, url, defaultHttpTimeout)
+       /* warmup requests (FIB, pool allocations) */
+       for i := 0; i < 5; i++ {
+               time.Sleep(time.Second * 1)
+               promReq(s, url, defaultHttpTimeout)
+       }
+
+       /* let's give it some time to clean up sessions, so pool elements can be reused and we have less noise */
+       time.Sleep(time.Second * 12)
 
        vpp.EnableMemoryTrace()
        traces1, err := vpp.GetMemoryTrace()
@@ -918,7 +924,7 @@ func PromMemLeakTest(s *Http1Suite) {
        }
 
        /* let's give it some time to clean up sessions */
-       time.Sleep(time.Second * 5)
+       time.Sleep(time.Second * 12)
 
        traces2, err := vpp.GetMemoryTrace()
        s.AssertNil(err, fmt.Sprint(err))