Optimize `TestEventsContainerFailStartDie`

Optimize performance of `TestEventsContainerFailStartDie`

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
This commit is contained in:
Zhang Wei 2016-01-26 19:23:18 +08:00
parent 5b0183e91c
commit 4f7dda3fb2
1 changed files with 3 additions and 5 deletions

View File

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