Optimize TestEventsContainerFailStartDie
Optimize performance of `TestEventsContainerFailStartDie` Signed-off-by: Zhang Wei <zhangwei555@huawei.com> Upstream-commit: 4f7dda3fb29b2ac39731b1a54571ad96435fff83 Component: engine
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user