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 <avillin@cisco.com>
This commit is contained in:
Adrian Villin
2024-12-06 10:26:48 +01:00
committed by Florin Coras
parent f0a126a1eb
commit a661b90a4c

View File

@ -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)
}
}