Browse code

TestLogsFollowSlowStdoutConsumer: fix for slow ARM

We run our CI on Scaleway C1 machine, which is pretty slow,
including I/O. This test was failing on it, as it tried to
write 100000 lines of log very fast, and the loggerCloseTimeout
(defined and used in container/monitor.go) prevents the
daemon to finish writing it within this time frame,

Reducing the size to 150000 characters (75000 lines) should
help avoiding hitting it, without compromising the test case
itself.

Alternatively, we could have increased the timeout further. It was
originally set to 1s (commit b6a42673a) and later increased 10x
(commit c0391bf55). Please let me know if you want me to go that way.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>

Kir Kolyshkin authored on 2017/09/19 00:47:55
Showing 1 changed files
... ...
@@ -214,14 +214,15 @@ func (s *DockerSuite) TestLogsSinceFutureFollow(c *check.C) {
214 214
 func (s *DockerSuite) TestLogsFollowSlowStdoutConsumer(c *check.C) {
215 215
 	// TODO Windows: Fix this test for TP5.
216 216
 	testRequires(c, DaemonIsLinux)
217
-	out, _ := dockerCmd(c, "run", "-d", "busybox", "/bin/sh", "-c", `usleep 600000;yes X | head -c 200000`)
217
+	expected := 150000
218
+	out, _ := dockerCmd(c, "run", "-d", "busybox", "/bin/sh", "-c", fmt.Sprintf("usleep 600000; yes X | head -c %d", expected))
218 219
 
219 220
 	id := strings.TrimSpace(out)
220 221
 
221 222
 	stopSlowRead := make(chan bool)
222 223
 
223 224
 	go func() {
224
-		exec.Command(dockerBinary, "wait", id).Run()
225
+		dockerCmd(c, "wait", id)
225 226
 		stopSlowRead <- true
226 227
 	}()
227 228
 
... ...
@@ -239,7 +240,6 @@ func (s *DockerSuite) TestLogsFollowSlowStdoutConsumer(c *check.C) {
239 239
 	c.Assert(err, checker.IsNil)
240 240
 
241 241
 	actual := bytes1 + bytes2
242
-	expected := 200000
243 242
 	c.Assert(actual, checker.Equals, expected)
244 243
 }
245 244