Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix a possible race condition in cloudprober_test
Browse files Browse the repository at this point in the history
manugarg committed Dec 13, 2023
1 parent 6fda568 commit db8ef43
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cloudprober_test.go
Original file line number Diff line number Diff line change
@@ -248,8 +248,11 @@ func TestCloudproberConfig(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
configSrc := config.ConfigSourceWithFile(tt.fileName)

cloudProber.Lock()
cloudProber.configSource = configSrc
cloudProber.config, _ = configSrc.GetConfig()
cloudProber.Unlock()

assert.Equal(t, tt.wantProbename, GetConfig().GetProbe()[0].GetName(), "GetConfig()")
assert.Equal(t, tt.wantRawConfig, GetRawConfig(), "GetRawConfig()")

0 comments on commit db8ef43

Please sign in to comment.