hs-test: keep ab/wrk containers alive until teardown 63/40963/2
authorAdrian Villin <[email protected]>
Wed, 5 Jun 2024 09:53:50 +0000 (05:53 -0400)
committerDave Wallace <[email protected]>
Wed, 5 Jun 2024 16:57:00 +0000 (16:57 +0000)
- Fixes errors while obtaining container logs on test failure
  (NginxPerf tests), ab/wrk containers are now stopped on test teardown
  like other containers.

Type: test

Change-Id: Ic336fcd3ed6bf68dd345d378262cb28eb5efc789
Signed-off-by: Adrian Villin <[email protected]>
extras/hs-test/container.go
extras/hs-test/http_test.go

index 44d84d5..080eb73 100644 (file)
@@ -180,7 +180,7 @@ func (c *Container) prepareCommand() (string, error) {
 
        cmd := "docker run "
        if c.runDetached {
-               cmd += " -d"
+               cmd += " -dt"
        }
 
        c.allocateCpus()
index 4f7ed93..875d489 100644 (file)
@@ -247,6 +247,7 @@ func runNginxPerf(s *NoTopoSuite, mode, ab_or_wrk string) error {
 
        if ab_or_wrk == "ab" {
                abCont := s.getContainerByName("ab")
+               abCont.runDetached = true
                args := fmt.Sprintf("-n %d -c %d", nRequests, nClients)
                if mode == "rps" {
                        args += " -k"
@@ -264,6 +265,7 @@ func runNginxPerf(s *NoTopoSuite, mode, ab_or_wrk string) error {
                s.assertNil(err, "err: '%s', output: '%s'", err, o)
        } else {
                wrkCont := s.getContainerByName("wrk")
+               wrkCont.runDetached = true
                args := fmt.Sprintf("-c %d -t 2 -d 30 http://%s:80/64B.json", nClients,
                        serverAddress)
                wrkCont.extraRunningArgs = args