Commit 7b2c80f
authored
tests(commands/mcms): isolate cobra command per parallel subtest (#734)
## What changed
- Updated `TestSubcommands_HaveRequiredFlags` in
`engine/cld/commands/mcms/command_test.go` so each parallel subtest
creates its own command instance.
- Removed the shared command instance that was previously reused across
parallel subtests.
## Why
Consistently failing for test due to race condition -
https://github.com/smartcontractkit/chainlink-deployments-framework/actions/runs/22008698619/job/63598036705
```
==================
==================
WARNING: DATA RACE
Read at 0x00c000b65560 by goroutine 212:
github.com/spf13/pflag.(*FlagSet).VisitAll()
/home/runner/go/pkg/mod/github.com/spf13/pflag@v1.0.10/flag.go:305 +0x3a
github.com/spf13/pflag.(*FlagSet).AddFlagSet()
/home/runner/go/pkg/mod/github.com/spf13/pflag@v1.0.10/flag.go:915 +0x93
github.com/spf13/cobra.(*Command).mergePersistentFlags()
/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.10.1/command.go:1900 +0x2f
github.com/spf13/cobra.stripFlags()
/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.10.1/command.go:678 +0x64
github.com/spf13/cobra.(*Command).Find.func1()
```
```
==================
--- FAIL: TestSubcommands_HaveRequiredFlags (0.00s)
--- FAIL: TestSubcommands_HaveRequiredFlags/analyze-proposal (0.00s)
testing.go:1617: race detected during execution of test
--- FAIL: TestSubcommands_HaveRequiredFlags/execute-fork (0.00s)
testing.go:1617: race detected during execution of test
--- FAIL: TestSubcommands_HaveRequiredFlags/error-decode-evm (0.00s)
testing.go:1617: race detected during execution of test
```1 parent f6d7d5c commit 7b2c80f
1 file changed
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | 129 | | |
133 | 130 | | |
134 | 131 | | |
| |||
155 | 152 | | |
156 | 153 | | |
157 | 154 | | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
| |||
0 commit comments