diff options
Diffstat (limited to 'extras/hs-test/ldp_test.go')
-rw-r--r-- | extras/hs-test/ldp_test.go | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/extras/hs-test/ldp_test.go b/extras/hs-test/ldp_test.go index 03636b11191..e72fac4fbba 100644 --- a/extras/hs-test/ldp_test.go +++ b/extras/hs-test/ldp_test.go @@ -2,6 +2,7 @@ package main import ( "fmt" + "time" . "fd.io/hs-test/infra" . "github.com/onsi/ginkgo/v2" @@ -24,6 +25,10 @@ func LDPreloadIperfVppTest(s *LdpSuite) { clnCh := make(chan error) clnRes := make(chan string, 1) + defer func() { + stopServerCh <- struct{}{} + }() + go func() { defer GinkgoRecover() cmd := "iperf3 -4 -s -p " + s.GetPortFromPpid() @@ -39,14 +44,9 @@ func LDPreloadIperfVppTest(s *LdpSuite) { cmd := "iperf3 -c " + serverVethAddress + " -u -l 1460 -b 10g -p " + s.GetPortFromPpid() s.StartClientApp(clientContainer, cmd, clnCh, clnRes) }() - s.Log(<-clnRes) - - // wait for client's result - err = <-clnCh - s.AssertNil(err, fmt.Sprint(err)) - // stop server - stopServerCh <- struct{}{} + s.AssertChannelClosed(time.Minute*3, clnCh) + s.Log(<-clnRes) } func RedisBenchmarkTest(s *LdpSuite) { @@ -61,6 +61,10 @@ func RedisBenchmarkTest(s *LdpSuite) { clnCh := make(chan error) clnRes := make(chan string, 1) + defer func() { + doneSrv <- struct{}{} + }() + go func() { defer GinkgoRecover() cmd := "redis-server --daemonize yes --protected-mode no --bind " + serverVethAddress @@ -79,12 +83,10 @@ func RedisBenchmarkTest(s *LdpSuite) { cmd = "redis-benchmark --threads " + fmt.Sprint(*NConfiguredCpus) + "-h " + serverVethAddress } s.StartClientApp(clientContainer, cmd, clnCh, clnRes) + }() + // 4.5 minutes + s.AssertChannelClosed(time.Second*270, clnCh) s.Log(<-clnRes) - // wait for client's result - err = <-clnCh - s.AssertNil(err, fmt.Sprint(err)) - // stop server - doneSrv <- struct{}{} } |