@@ -16,7 +16,6 @@ import (
1616
1717// This used to work, it test a log of PageSize-1 (gh#4851)
1818func (s * DockerSuite ) TestLogsContainerSmallerThanPage (c * check.C ) {
19- testRequires (c , DaemonIsLinux )
2019 testLen := 32767
2120 out , _ := dockerCmd (c , "run" , "-d" , "busybox" , "sh" , "-c" , fmt .Sprintf ("for i in $(seq 1 %d); do echo -n =; done; echo" , testLen ))
2221
@@ -30,7 +29,6 @@ func (s *DockerSuite) TestLogsContainerSmallerThanPage(c *check.C) {
3029
3130// Regression test: When going over the PageSize, it used to panic (gh#4851)
3231func (s * DockerSuite ) TestLogsContainerBiggerThanPage (c * check.C ) {
33- testRequires (c , DaemonIsLinux )
3432 testLen := 32768
3533 out , _ := dockerCmd (c , "run" , "-d" , "busybox" , "sh" , "-c" , fmt .Sprintf ("for i in $(seq 1 %d); do echo -n =; done; echo" , testLen ))
3634
@@ -44,7 +42,6 @@ func (s *DockerSuite) TestLogsContainerBiggerThanPage(c *check.C) {
4442
4543// Regression test: When going much over the PageSize, it used to block (gh#4851)
4644func (s * DockerSuite ) TestLogsContainerMuchBiggerThanPage (c * check.C ) {
47- testRequires (c , DaemonIsLinux )
4845 testLen := 33000
4946 out , _ := dockerCmd (c , "run" , "-d" , "busybox" , "sh" , "-c" , fmt .Sprintf ("for i in $(seq 1 %d); do echo -n =; done; echo" , testLen ))
5047
@@ -57,7 +54,6 @@ func (s *DockerSuite) TestLogsContainerMuchBiggerThanPage(c *check.C) {
5754}
5855
5956func (s * DockerSuite ) TestLogsTimestamps (c * check.C ) {
60- testRequires (c , DaemonIsLinux )
6157 testLen := 100
6258 out , _ := dockerCmd (c , "run" , "-d" , "busybox" , "sh" , "-c" , fmt .Sprintf ("for i in $(seq 1 %d); do echo =; done;" , testLen ))
6359
@@ -83,7 +79,6 @@ func (s *DockerSuite) TestLogsTimestamps(c *check.C) {
8379}
8480
8581func (s * DockerSuite ) TestLogsSeparateStderr (c * check.C ) {
86- testRequires (c , DaemonIsLinux )
8782 msg := "stderr_log"
8883 out , _ := dockerCmd (c , "run" , "-d" , "busybox" , "sh" , "-c" , fmt .Sprintf ("echo %s 1>&2" , msg ))
8984
@@ -100,6 +95,8 @@ func (s *DockerSuite) TestLogsSeparateStderr(c *check.C) {
10095}
10196
10297func (s * DockerSuite ) TestLogsStderrInStdout (c * check.C ) {
98+ // TODO Windows: Needs investigation why this fails. Obtained string includes
99+ // a bunch of ANSI escape sequences before the "stderr_log" message.
103100 testRequires (c , DaemonIsLinux )
104101 msg := "stderr_log"
105102 out , _ := dockerCmd (c , "run" , "-d" , "-t" , "busybox" , "sh" , "-c" , fmt .Sprintf ("echo %s 1>&2" , msg ))
@@ -115,7 +112,6 @@ func (s *DockerSuite) TestLogsStderrInStdout(c *check.C) {
115112}
116113
117114func (s * DockerSuite ) TestLogsTail (c * check.C ) {
118- testRequires (c , DaemonIsLinux )
119115 testLen := 100
120116 out , _ := dockerCmd (c , "run" , "-d" , "busybox" , "sh" , "-c" , fmt .Sprintf ("for i in $(seq 1 %d); do echo =; done;" , testLen ))
121117
@@ -142,7 +138,6 @@ func (s *DockerSuite) TestLogsTail(c *check.C) {
142138}
143139
144140func (s * DockerSuite ) TestLogsFollowStopped (c * check.C ) {
145- testRequires (c , DaemonIsLinux )
146141 out , _ := dockerCmd (c , "run" , "-d" , "busybox" , "echo" , "hello" )
147142
148143 id := strings .TrimSpace (out )
@@ -160,13 +155,12 @@ func (s *DockerSuite) TestLogsFollowStopped(c *check.C) {
160155 select {
161156 case err := <- errChan :
162157 c .Assert (err , checker .IsNil )
163- case <- time .After (1 * time .Second ):
158+ case <- time .After (30 * time .Second ):
164159 c .Fatal ("Following logs is hanged" )
165160 }
166161}
167162
168163func (s * DockerSuite ) TestLogsSince (c * check.C ) {
169- testRequires (c , DaemonIsLinux )
170164 name := "testlogssince"
171165 dockerCmd (c , "run" , "--name=" + name , "busybox" , "/bin/sh" , "-c" , "for i in $(seq 1 3); do sleep 2; echo log$i; done" )
172166 out , _ := dockerCmd (c , "logs" , "-t" , name )
@@ -202,6 +196,7 @@ func (s *DockerSuite) TestLogsSince(c *check.C) {
202196}
203197
204198func (s * DockerSuite ) TestLogsSinceFutureFollow (c * check.C ) {
199+ // TODO Windows: Flakey on TP4. Enable for next technical preview.
205200 testRequires (c , DaemonIsLinux )
206201 name := "testlogssincefuturefollow"
207202 out , _ := dockerCmd (c , "run" , "-d" , "--name" , name , "busybox" , "/bin/sh" , "-c" , `for i in $(seq 1 5); do echo log$i; sleep 1; done` )
@@ -210,7 +205,7 @@ func (s *DockerSuite) TestLogsSinceFutureFollow(c *check.C) {
210205 // our `--since` argument. Because the log producer runs in the background,
211206 // we need to check repeatedly for some output to be produced.
212207 var timestamp string
213- for i := 0 ; i != 5 && timestamp == "" ; i ++ {
208+ for i := 0 ; i != 100 && timestamp == "" ; i ++ {
214209 if out , _ = dockerCmd (c , "logs" , "-t" , name ); out == "" {
215210 time .Sleep (time .Millisecond * 100 ) // Retry
216211 } else {
@@ -235,6 +230,7 @@ func (s *DockerSuite) TestLogsSinceFutureFollow(c *check.C) {
235230
236231// Regression test for #8832
237232func (s * DockerSuite ) TestLogsFollowSlowStdoutConsumer (c * check.C ) {
233+ // TODO Windows: Consider enabling post-TP4. Too expensive to run on TP4
238234 testRequires (c , DaemonIsLinux )
239235 out , _ := dockerCmd (c , "run" , "-d" , "busybox" , "/bin/sh" , "-c" , `usleep 600000;yes X | head -c 200000` )
240236
@@ -266,7 +262,6 @@ func (s *DockerSuite) TestLogsFollowSlowStdoutConsumer(c *check.C) {
266262}
267263
268264func (s * DockerSuite ) TestLogsFollowGoroutinesWithStdout (c * check.C ) {
269- testRequires (c , DaemonIsLinux )
270265 out , _ := dockerCmd (c , "run" , "-d" , "busybox" , "/bin/sh" , "-c" , "while true; do echo hello; sleep 2; done" )
271266 id := strings .TrimSpace (out )
272267 c .Assert (waitRun (id ), checker .IsNil )
@@ -318,7 +313,6 @@ func (s *DockerSuite) TestLogsFollowGoroutinesWithStdout(c *check.C) {
318313}
319314
320315func (s * DockerSuite ) TestLogsFollowGoroutinesNoOutput (c * check.C ) {
321- testRequires (c , DaemonIsLinux )
322316 out , _ := dockerCmd (c , "run" , "-d" , "busybox" , "/bin/sh" , "-c" , "while true; do sleep 2; done" )
323317 id := strings .TrimSpace (out )
324318 c .Assert (waitRun (id ), checker .IsNil )
0 commit comments