fix: use copy of loop variable in parallel test (#23669)
fix: use copy of loop variable in parallel test (#23669)

This fixes an occurrence of a loop variable being captured in a
parallel test. With the previous code, only the last test case is
actually exercised. To work around this problem, we create a local
copy of the range variable before the parallel test, as suggested in
the Go documentation for the `testing` package:

https://pkg.go.dev/testing#hdr-Subtests_and_Sub_benchmarks

Issue was found automatically using the `loopvarcapture` linter.
li-ang/influxdb,influxdata/influxdb,influxdata/influxdb,li-ang/influxdb