Skip to content

Commit 7d2438f

Browse files
committed
InitConfigObject has to lock to avoid test flakiness
1 parent 6a1a253 commit 7d2438f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pkg/config/setup/config.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,9 @@ func InitConfigObjects(cliPath string, defaultDir string) {
304304
// We first load the configuration to see which config library should be used.
305305
configLib := resolveConfigLibType(cliPath, defaultDir)
306306

307-
datadog = create.NewConfig("datadog", configLib)
308-
systemProbe = create.NewConfig("system-probe", configLib)
307+
// Assign the config globals, using locks to make the tests happy
308+
SetDatadog(create.NewConfig("datadog", configLib)) // nolint: forbidigo // legitimate use of SetDatadog
309+
SetSystemProbe(create.NewConfig("system-probe", configLib)) // nolint: forbidigo // legitimate use of SetDatadog
309310

310311
// Configuration defaults
311312
initConfig()

0 commit comments

Comments
 (0)