kubernetes/pkg/controller/volume/persistentvolume
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
..
config generated: Run hack/update-gofmt.sh 2021-08-24 15:47:49 -04:00
metrics hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
options hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
testing Generate and format files 2022-07-26 13:14:05 -04:00
binder_test.go Generate and format files 2022-07-26 13:14:05 -04:00
delete_test.go Generate and format files 2022-07-26 13:14:05 -04:00
framework_test.go Fix capture loop vars in parallel or ginkgo tests 2022-08-15 16:28:50 +02:00
index.go Generate and format files 2022-07-26 13:14:05 -04:00
index_test.go Cleanup k8s.io/component-helpers/storage/volume package 2022-03-16 15:43:09 +08:00
OWNERS Check in OWNERS modified by update-yamlfmt.sh 2021-12-09 21:31:26 -05:00
provision_test.go Generate and format files 2022-07-26 13:14:05 -04:00
pv_controller.go allow retroactive storage class assignment in pv controller 2022-08-02 20:52:04 +02:00
pv_controller_base.go Clean shutdown of volume integration tests 2022-07-14 11:25:57 +02:00
pv_controller_test.go Merge pull request #111467 from RomanBednar/retro-sc-assignment 2022-08-02 15:05:57 -07:00
recycle_test.go Generate and format files 2022-07-26 13:14:05 -04:00
volume_host.go kubelet: add GetHostIDsForPod() 2022-08-03 19:53:22 +02:00