From 2f4aa9658408ac72a598363c6e22eadf93dbb8a7 Mon Sep 17 00:00:00 2001 From: Aaron Lehmann Date: Tue, 15 Mar 2016 16:26:16 -0700 Subject: [PATCH] Fix flaky test TestTransfer This test was checking that it received every progress update that was produced. But delivery of these intermediate progress updates is not guaranteed. A new update can overwrite the previous one if the previous one hasn't been sent to the channel yet. The call to t.Fatalf exited the current goroutine which was consuming the channel, which caused a deadlock and eventual test timeout rather than a proper failure message. Failure seen here: https://jenkins.dockerproject.org/job/Docker-PRs-experimental/16400/console Signed-off-by: Aaron Lehmann --- distribution/xfer/transfer_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/distribution/xfer/transfer_test.go b/distribution/xfer/transfer_test.go index c9c9a20a6d..39fb7d080a 100644 --- a/distribution/xfer/transfer_test.go +++ b/distribution/xfer/transfer_test.go @@ -41,7 +41,7 @@ func TestTransfer(t *testing.T) { if p.Current != 0 { t.Fatalf("got unexpected progress value: %d (expected 0)", p.Current) } - } else if p.Current != val+1 { + } else if p.Current <= val { t.Fatalf("got unexpected progress value: %d (expected %d)", p.Current, val+1) } receivedProgress[p.ID] = p.Current