kubernetes/test/e2e/cloud/gcp
Omer Tuchfeld eb317ecd40 Fix capture loop vars in parallel or ginkgo tests
Fixes instances of #98213 (to ultimately complete #98213 linting is
required).

This commit fixes a few instances of a common mistake done when writing
parallel subtests or Ginkgo tests (basically any test in which the test
closure is dynamically created in a loop and the loop doesn't wait for
the test closure to complete).

I'm developing a very specific linter that detects this king of mistake
and these are the only violations of it it found in this repo (it's not
airtight so there may be more).

In the case of Ginkgo tests, without this fix, only the last entry in
the loop iteratee is actually tested. In the case of Parallel tests I
think it's the same problem but maybe a bit different, iiuc it depends
on the execution speed.

Waiting for the CI to confirm the tests are still passing, even after
this fix - since it's likely it's the first time those test cases are
executed - they may be buggy or testing code that is buggy.

Another instance of this is in `test/e2e/storage/csi_mock_volume.go` and
is still failing so it has been left out of this commit and will be
addressed in a separate one
2022-08-15 16:28:50 +02:00
..
apps update ginkgo from v1 to v2 and gomega to 1.19.0 2022-07-08 10:44:46 +08:00
auth update ginkgo from v1 to v2 and gomega to 1.19.0 2022-07-08 10:44:46 +08:00
common Move GPU upgrade tests to node directory 2021-03-12 08:00:11 +01:00
network update ginkgo from v1 to v2 and gomega to 1.19.0 2022-07-08 10:44:46 +08:00
node update ginkgo from v1 to v2 and gomega to 1.19.0 2022-07-08 10:44:46 +08:00
addon_update.go update ginkgo from v1 to v2 and gomega to 1.19.0 2022-07-08 10:44:46 +08:00
cluster_upgrade.go Generate and format files 2022-07-26 13:14:05 -04:00
framework.go update ginkgo from v1 to v2 and gomega to 1.19.0 2022-07-08 10:44:46 +08:00
gke_node_pools.go update ginkgo from v1 to v2 and gomega to 1.19.0 2022-07-08 10:44:46 +08:00
ha_master.go update ginkgo from v1 to v2 and gomega to 1.19.0 2022-07-08 10:44:46 +08:00
imports.go Split upgrade tests into sig-owned directories 2021-03-13 12:35:15 +01:00
kubelet_security.go Fix capture loop vars in parallel or ginkgo tests 2022-08-15 16:28:50 +02:00
node_lease.go update ginkgo from v1 to v2 and gomega to 1.19.0 2022-07-08 10:44:46 +08:00
OWNERS Check in OWNERS modified by update-yamlfmt.sh 2021-12-09 21:31:26 -05:00
reboot.go Generate and format files 2022-07-26 13:14:05 -04:00
recreate_node.go Stop using the deprecated method CurrentGinkgoTestDescription 2022-07-08 10:46:11 +08:00
resize_nodes.go update ginkgo from v1 to v2 and gomega to 1.19.0 2022-07-08 10:44:46 +08:00
restart.go update ginkgo from v1 to v2 and gomega to 1.19.0 2022-07-08 10:44:46 +08:00