From 0c887404a850d74c807816ffbfb7a7cdb8c0100a Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 22 Sep 2021 17:12:45 +0200 Subject: [PATCH] daemon: fix TestVerifyPlatformContainerResources not capturing variable This test runs with t.Parallel() _and_ uses subtests, but didn't capture the `tc` variable, which potentialy (likely) makes it test the same testcase multiple times. Signed-off-by: Sebastiaan van Stijn --- daemon/daemon_unix_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/daemon/daemon_unix_test.go b/daemon/daemon_unix_test.go index 65244ad5769cb..9c1b146ca19bb 100644 --- a/daemon/daemon_unix_test.go +++ b/daemon/daemon_unix_test.go @@ -356,6 +356,7 @@ func TestVerifyPlatformContainerResources(t *testing.T) { }, } for _, tc := range tests { + tc := tc t.Run(tc.name, func(t *testing.T) { t.Parallel() warnings, err := verifyPlatformContainerResources(&tc.resources, &tc.sysInfo, tc.update)