Zach Wasserman
efbc2b92bb
Fix race condition in updates test (#4661)
Copy the DefaultOptions in order to prevent a data race on the Targets
map. This race should only have effected testing.
Race detector output:
```
WARNING: DATA RACE
Read at 0x00c0000908d0 by goroutine 15:
runtime.mapaccess1_faststr()
/opt/hostedtoolcache/go/1.18.0/x64/src/runtime/map_faststr.go:13 +0x0
github.com/fleetdm/fleet/v4/orbit/pkg/update.TestMakeRepoPath.func1()
/home/runner/work/fleet/fleet/orbit/pkg/update/update_test.go:58 +0xb6
testing.tRunner()
/opt/hostedtoolcache/go/1.18.0/x64/src/testing/testing.go:1439 +0x213
testing.(*T).Run.func1()
/opt/hostedtoolcache/go/1.18.0/x64/src/testing/testing.go:1486 +0x47
Previous write at 0x00c0000908d0 by goroutine 12:
runtime.mapassign_faststr()
/opt/hostedtoolcache/go/1.18.0/x64/src/runtime/map_faststr.go:203 +0x0
github.com/fleetdm/fleet/v4/orbit/pkg/update.TestMakeRepoPath.func1()
/home/runner/work/fleet/fleet/orbit/pkg/update/update_test.go:62 +0x1cb
testing.tRunner()
/opt/hostedtoolcache/go/1.18.0/x64/src/testing/testing.go:1439 +0x213
testing.(*T).Run.func1()
/opt/hostedtoolcache/go/1.18.0/x64/src/testing/testing.go:1486 +0x47
Goroutine 15 (running) created at:
testing.(*T).Run()
/opt/hostedtoolcache/go/1.18.0/x64/src/testing/testing.go:1486 +0x724
github.com/fleetdm/fleet/v4/orbit/pkg/update.TestMakeRepoPath()
/home/runner/work/fleet/fleet/orbit/pkg/update/update_test.go:53 +0x1a4
testing.tRunner()
/opt/hostedtoolcache/go/1.18.0/x64/src/testing/testing.go:1439 +0x213
testing.(*T).Run.func1()
/opt/hostedtoolcache/go/1.18.0/x64/src/testing/testing.go:1486 +0x47
Goroutine 12 (running) created at:
testing.(*T).Run()
/opt/hostedtoolcache/go/1.18.0/x64/src/testing/testing.go:1486 +0x724
github.com/fleetdm/fleet/v4/orbit/pkg/update.TestMakeRepoPath()
/home/runner/work/fleet/fleet/orbit/pkg/update/update_test.go:53 +0x1a4
testing.tRunner()
/opt/hostedtoolcache/go/1.18.0/x64/src/testing/testing.go:1439 +0x213
testing.(*T).Run.func1()
/opt/hostedtoolcache/go/1.18.0/x64/src/testing/testing.go:1486
+0x47
```
2022-03-18 09:30:45 -07:00
..
2022-03-16 10:15:25 -04:00
2022-03-09 17:22:29 -05:00
2022-03-16 10:15:25 -04:00
2022-03-18 09:30:45 -07:00
2022-01-19 10:52:14 -05:00
2022-03-15 16:51:00 -03:00
2022-03-15 16:51:00 -03:00
2022-01-19 10:52:14 -05:00
2022-03-09 17:22:29 -05:00
2022-01-01 12:41:32 -06:00
2022-03-15 16:51:00 -03:00
2022-02-14 15:13:44 -03:00
2022-01-19 10:52:14 -05:00
2022-03-16 10:15:25 -04:00
2022-02-02 15:50:09 -08:00
2022-01-26 09:47:56 -05:00
2022-02-16 09:23:27 -05:00
2022-02-02 16:34:37 -05:00
2021-11-22 09:13:26 -05:00
2021-12-30 16:00:10 -06:00