From a661b90a4c27eee810887b106d5e1e32205c0ee0 Mon Sep 17 00:00:00 2001 From: Adrian Villin Date: Fri, 6 Dec 2024 10:26:48 +0100 Subject: hs-test: remove client app retries - simple fix to avoid apps trying to start after a test timeout/interrupt Type: test Change-Id: I4e6fcbb2bb00c07e35cda1ebf6fcb76a913f7a32 Signed-off-by: Adrian Villin --- extras/hs-test/infra/utils.go | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/extras/hs-test/infra/utils.go b/extras/hs-test/infra/utils.go index 761fc178914..16a6a8c1dab 100644 --- a/extras/hs-test/infra/utils.go +++ b/extras/hs-test/infra/utils.go @@ -293,28 +293,18 @@ func (s *HstSuite) StartClientApp(c *Container, cmd string, }() s.Log("starting client app, please wait") + cmd2 := exec.Command("/bin/sh", "-c", "docker exec "+c.getEnvVarsAsCliOption()+" "+ + c.Name+" "+cmd) + s.Log(cmd2) + o, err := cmd2.CombinedOutput() - nTries := 0 - for { - // exec.Cmd can only be used once, which is why it's in the loop - cmd2 := exec.Command("/bin/sh", "-c", "docker exec "+c.getEnvVarsAsCliOption()+" "+ - c.Name+" "+cmd) - s.Log(cmd2) - o, err := cmd2.CombinedOutput() - if err != nil { - s.Log(err) - s.Log(string(o)) - if nTries > 5 { - clnRes <- "" - clnCh <- fmt.Errorf("failed to start client app '%s'", err) - s.AssertNil(err, fmt.Sprint(err)) - break - } - time.Sleep(1 * time.Second) - nTries++ - } else { - clnRes <- fmt.Sprintf("Client output: %s", o) - break - } + if err != nil { + s.Log(err) + s.Log(string(o)) + clnRes <- "" + clnCh <- fmt.Errorf("failed to start client app '%s'", err) + s.AssertNil(err, fmt.Sprint(err)) + } else { + clnRes <- fmt.Sprintf("Client output: %s", o) } } -- cgit