From 80dae646f644d745a57cecdb0ac2db01d7133d82 Mon Sep 17 00:00:00 2001 From: Evan Anderson Date: Fri, 10 May 2024 10:58:54 -0700 Subject: [PATCH] Resolve test flake --- internal/flags/flags_test.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/internal/flags/flags_test.go b/internal/flags/flags_test.go index 2120dd1f79..c283074832 100644 --- a/internal/flags/flags_test.go +++ b/internal/flags/flags_test.go @@ -32,6 +32,7 @@ import ( "github.com/stacklok/minder/internal/engine" ) +// nolint: tparallel func TestOpenFeatureProviderFromFlags(t *testing.T) { t.Parallel() @@ -76,9 +77,14 @@ idp_resolver: }, expectedFlag: true, }} + //nolint: paralleltest for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - t.Parallel() + // These tests need to be exclusive with each other, because openfeature + // uses a global variable to store the provider. + // Other tests can mock the openfeature client to avoid this, but this test + // specifically tests our interaction with the library, so we need exclusion here. + ctx := context.Background() OpenFeatureProviderFromFlags(ctx, tt.cfg)