@@ -69,9 +69,11 @@ func (s *DockerSuite) TestCliLogsTimestamps(c *check.C) {
6969 testLen := 100
7070 pullImageIfNotExist ("busybox" )
7171 out , _ := dockerCmd (c , "run" , "-d" , "busybox" , "sh" , "-c" , fmt .Sprintf ("for i in $(seq 1 %d); do echo =; done;" , testLen ))
72+ time .Sleep (5 * time .Second )
7273
7374 id := strings .TrimSpace (out )
7475 dockerCmd (c , "stop" , id )
76+ time .Sleep (5 * time .Second )
7577
7678 out , _ = dockerCmd (c , "logs" , "-t" , id )
7779
@@ -99,9 +101,11 @@ func (s *DockerSuite) TestCliLogsSeparateStderr(c *check.C) {
99101 pullImageIfNotExist ("busybox" )
100102 msg := "stderr_log"
101103 out , _ := dockerCmd (c , "run" , "-d" , "busybox" , "sh" , "-c" , fmt .Sprintf ("echo %s 1>&2" , msg ))
104+ time .Sleep (5 * time .Second )
102105
103106 id := strings .TrimSpace (out )
104107 dockerCmd (c , "stop" , id )
108+ time .Sleep (5 * time .Second )
105109
106110 stdout , stderr , _ := dockerCmdWithStdoutStderr (c , "logs" , id )
107111
@@ -120,9 +124,11 @@ func (s *DockerSuite) TestCliLogsStderrInStdout(c *check.C) {
120124 pullImageIfNotExist ("busybox" )
121125 msg := "stderr_log"
122126 out , _ := dockerCmd (c , "run" , "-d" , "-t" , "busybox" , "sh" , "-c" , fmt .Sprintf ("echo %s 1>&2" , msg ))
127+ time .Sleep (5 * time .Second )
123128
124129 id := strings .TrimSpace (out )
125130 dockerCmd (c , "stop" , id )
131+ time .Sleep (5 * time .Second )
126132
127133 stdout , stderr , _ := dockerCmdWithStdoutStderr (c , "logs" , id )
128134 c .Assert (stderr , checker .Equals , "" )
@@ -139,9 +145,11 @@ func (s *DockerSuite) TestCliLogsTail(c *check.C) {
139145 testLen := 100
140146 pullImageIfNotExist ("busybox" )
141147 out , _ := dockerCmd (c , "run" , "-d" , "busybox" , "sh" , "-c" , fmt .Sprintf ("for i in $(seq 1 %d); do echo =; done;" , testLen ))
148+ time .Sleep (5 * time .Second )
142149
143150 id := strings .TrimSpace (out )
144151 dockerCmd (c , "stop" , id )
152+ time .Sleep (5 * time .Second )
145153
146154 out , _ = dockerCmd (c , "logs" , "--tail" , "5" , id )
147155
@@ -169,9 +177,11 @@ func (s *DockerSuite) TestCliLogsFollowStopped(c *check.C) {
169177 testRequires (c , DaemonIsLinux )
170178 pullImageIfNotExist ("busybox" )
171179 out , _ := dockerCmd (c , "run" , "-d" , "busybox" , "echo" , "hello" )
180+ time .Sleep (5 * time .Second )
172181
173182 id := strings .TrimSpace (out )
174183 dockerCmd (c , "stop" , id )
184+ time .Sleep (5 * time .Second )
175185
176186 logsCmd := exec .Command (dockerBinary , "logs" , "-f" , id )
177187 c .Assert (logsCmd .Start (), checker .IsNil )
@@ -199,6 +209,7 @@ func (s *DockerSuite) TestCliLogsSince(c *check.C) {
199209 name := "testlogssince"
200210 dockerCmd (c , "run" , "--name=" + name , "-d" , "busybox" , "/bin/sh" , "-c" , "for i in $(seq 1 30); do sleep 2; echo log$i; done" )
201211 time .Sleep (5 * time .Second )
212+
202213 out , _ := dockerCmd (c , "logs" , "-t" , name )
203214
204215 log2Line := strings .Split (strings .Split (out , "\n " )[1 ], " " )
@@ -238,6 +249,7 @@ func (s *DockerSuite) TestCliLogsSinceFutureFollow(c *check.C) {
238249 testRequires (c , DaemonIsLinux )
239250 pullImageIfNotExist ("busybox" )
240251 out , _ := dockerCmd (c , "run" , "-d" , "busybox" , "/bin/sh" , "-c" , `for i in $(seq 1 50); do date +%s; sleep 1; done` )
252+ time .Sleep (5 * time .Second )
241253 id := strings .TrimSpace (out )
242254
243255 now := daemonTime (c ).Unix ()
@@ -260,13 +272,14 @@ func (s *DockerSuite) TestCliLogsFollowSlowStdoutConsumer(c *check.C) {
260272 testRequires (c , DaemonIsLinux )
261273 pullImageIfNotExist ("busybox" )
262274 out , _ := dockerCmd (c , "run" , "-d" , "busybox" , "/bin/sh" , "-c" , `usleep 600000;yes X | head -c 200000` )
263-
275+ time . Sleep ( 5 * time . Second )
264276 id := strings .TrimSpace (out )
265277
266278 stopSlowRead := make (chan bool )
267279
268280 go func () {
269281 exec .Command (dockerBinary , "stop" , id ).Run ()
282+ time .Sleep (5 * time .Second )
270283 stopSlowRead <- true
271284 }()
272285
0 commit comments