We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c70c40d commit 985b98bCopy full SHA for 985b98b
lib/auth/stableunixusers/stableunixusers_test.go
@@ -204,6 +204,7 @@ func TestStableUNIXUsers(t *testing.T) {
204
_, err = clusterConfiguration.UpsertAuthPreference(ctx, authPref)
205
require.NoError(t, err)
206
207
+ emitter.emitted = true
208
eg, ctx := errgroup.WithContext(ctx)
209
for i := range 1000 {
210
eg.Go(func() error {
@@ -219,7 +220,10 @@ type mockEmitter struct {
219
220
}
221
222
func (e *mockEmitter) EmitAuditEvent(ctx context.Context, ev apievents.AuditEvent) error {
- e.emitted = true
223
+ if !e.emitted {
224
+ // avoid racing a write if the flag is already set
225
+ e.emitted = true
226
+ }
227
return nil
228
229
0 commit comments