mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Optimize TestEventsContainerFailStartDie
Optimize performance of `TestEventsContainerFailStartDie` Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
This commit is contained in:
parent
5b0183e91c
commit
4f7dda3fb2
1 changed files with 3 additions and 5 deletions
|
@ -66,12 +66,10 @@ func (s *DockerSuite) TestEventsUntag(c *check.C) {
|
|||
}
|
||||
|
||||
func (s *DockerSuite) TestEventsContainerFailStartDie(c *check.C) {
|
||||
out, _ := dockerCmd(c, "images", "-q")
|
||||
image := strings.Split(out, "\n")[0]
|
||||
_, _, err := dockerCmdWithError("run", "--name", "testeventdie", image, "blerg")
|
||||
c.Assert(err, checker.NotNil, check.Commentf("Container run with command blerg should have failed, but it did not, out=%s", out))
|
||||
_, _, err := dockerCmdWithError("run", "--name", "testeventdie", "busybox", "blerg")
|
||||
c.Assert(err, checker.NotNil, check.Commentf("Container run with command blerg should have failed, but it did not"))
|
||||
|
||||
out, _ = dockerCmd(c, "events", "--since=0", fmt.Sprintf("--until=%d", daemonTime(c).Unix()))
|
||||
out, _ := dockerCmd(c, "events", "--since=0", fmt.Sprintf("--until=%d", daemonTime(c).Unix()))
|
||||
events := strings.Split(strings.TrimSpace(out), "\n")
|
||||
|
||||
nEvents := len(events)
|
||||
|
|
Loading…
Add table
Reference in a new issue