From fc153750ed8b59e9fede94d17102346992396ecb Mon Sep 17 00:00:00 2001 From: Ting-Yu Wang Date: Tue, 29 Dec 2020 20:22:24 -0800 Subject: Deflake TestBindOverlay in //test/e2e:integration_test Test failure happens when `echo` writes late: * Server nc shuts down write when it sees EOF from stdin. * Client nc closes the connection when it detects EOF from socket and no data in internal write buffer. Using `-q` flag to make server not shutting down write in the beginning, while letting connection to be closed by client. As `-q` flag's default value varies in different netcat versions, we always specify it to prevent future breakage. PiperOrigin-RevId: 349504016 --- test/e2e/regression_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/e2e/regression_test.go') diff --git a/test/e2e/regression_test.go b/test/e2e/regression_test.go index 70bbe5121..84564cdaa 100644 --- a/test/e2e/regression_test.go +++ b/test/e2e/regression_test.go @@ -35,7 +35,7 @@ func TestBindOverlay(t *testing.T) { // Run the container. got, err := d.Run(ctx, dockerutil.RunOpts{ Image: "basic/ubuntu", - }, "bash", "-c", "nc -l -U /var/run/sock & p=$! && sleep 1 && echo foobar-asdf | nc -U /var/run/sock && wait $p") + }, "bash", "-c", "nc -q -1 -l -U /var/run/sock & p=$! && sleep 1 && echo foobar-asdf | nc -q 0 -U /var/run/sock && wait $p") if err != nil { t.Fatalf("docker run failed: %v", err) } -- cgit v1.2.3