From 0b9e6c4132f8d834dff458b0e3bb523125fa064f Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Wed, 11 Dec 2019 13:21:25 +0100 Subject: [PATCH] Run manifest image update unit tests in parallel I previously disabled parallel tests in 7d9e02dac62b331c04915d540e6fd42e96e2c308 thinking it would fix the flaky unit tests in CircleCI. Parallelization wasn't the culprit. On the way I also found out that tests were not really running in parallel due to `t.Parallel()` being called after the test is run. --- pkg/cluster/kubernetes/update_test.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkg/cluster/kubernetes/update_test.go b/pkg/cluster/kubernetes/update_test.go index da68505ed..55fc0c386 100644 --- a/pkg/cluster/kubernetes/update_test.go +++ b/pkg/cluster/kubernetes/update_test.go @@ -76,11 +76,13 @@ func TestWorkloadContainerUpdates(t *testing.T) { {"initContainer", case15resource, case15containers, case15image, case15, case15out, emptyContainerImageMap}, } { t.Run(c.name, func(t *testing.T) { - switch c.imageAnnotations { + localC := c // to avoid races between the parallel tests + t.Parallel() + switch localC.imageAnnotations { case emptyContainerImageMap: - testUpdateWorkloadContainer(t, c) + testUpdateWorkloadContainer(t, localC) default: - testUpdateWorkloadImagePath(t, c) + testUpdateWorkloadImagePath(t, localC) } }) }