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:

committed by
Florin Coras

parent
f0a126a1eb
commit
a661b90a4c
@ -293,28 +293,18 @@ func (s *HstSuite) StartClientApp(c *Container, cmd string,
|
|||||||
}()
|
}()
|
||||||
|
|
||||||
s.Log("starting client app, please wait")
|
s.Log("starting client app, please wait")
|
||||||
|
|
||||||
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()+" "+
|
cmd2 := exec.Command("/bin/sh", "-c", "docker exec "+c.getEnvVarsAsCliOption()+" "+
|
||||||
c.Name+" "+cmd)
|
c.Name+" "+cmd)
|
||||||
s.Log(cmd2)
|
s.Log(cmd2)
|
||||||
o, err := cmd2.CombinedOutput()
|
o, err := cmd2.CombinedOutput()
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
s.Log(err)
|
s.Log(err)
|
||||||
s.Log(string(o))
|
s.Log(string(o))
|
||||||
if nTries > 5 {
|
|
||||||
clnRes <- ""
|
clnRes <- ""
|
||||||
clnCh <- fmt.Errorf("failed to start client app '%s'", err)
|
clnCh <- fmt.Errorf("failed to start client app '%s'", err)
|
||||||
s.AssertNil(err, fmt.Sprint(err))
|
s.AssertNil(err, fmt.Sprint(err))
|
||||||
break
|
|
||||||
}
|
|
||||||
time.Sleep(1 * time.Second)
|
|
||||||
nTries++
|
|
||||||
} else {
|
} else {
|
||||||
clnRes <- fmt.Sprintf("Client output: %s", o)
|
clnRes <- fmt.Sprintf("Client output: %s", o)
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user