Browse code

Fix flaky test TestTransfer (take 2)

TestTransfer failed in CI:
https://jenkins.dockerproject.org/job/Docker-PRs-experimental/17103/console

This is the same issue as https://github.com/docker/docker/pull/21233,
but only one of the code paths was fixed in that PR. The one which
handles the first progress update was not - it still assumed that the
progress indication should be 0/10.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>

Aaron Lehmann authored on 2016/03/29 10:27:29
Showing 1 changed files
... ...
@@ -37,11 +37,7 @@ func TestTransfer(t *testing.T) {
37 37
 	go func() {
38 38
 		for p := range progressChan {
39 39
 			val, present := receivedProgress[p.ID]
40
-			if !present {
41
-				if p.Current != 0 {
42
-					t.Fatalf("got unexpected progress value: %d (expected 0)", p.Current)
43
-				}
44
-			} else if p.Current <= val {
40
+			if present && p.Current <= val {
45 41
 				t.Fatalf("got unexpected progress value: %d (expected %d)", p.Current, val+1)
46 42
 			}
47 43
 			receivedProgress[p.ID] = p.Current