Skip to content

Commit

Permalink
fix(kubernetes_admission_events): flush events after emitting them
Browse files Browse the repository at this point in the history
Signed-off-by: Wassim DHIF <[email protected]>
  • Loading branch information
wdhif committed Dec 23, 2024
1 parent 528fb2d commit 673ab1a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,9 @@ func TestKubernetesAdmissionEvents(t *testing.T) {
// Emit the event
start := time.Now()
mockSender.On("Event", mock.AnythingOfType("event.Event")).Return().Once()
validated, err := kubernetesAuditWebhook.emitEvent(&tt.request, "", nil)
// Force flush to serializer to ensure the event is emitted and received.
demultiplexerMock.ForceFlushToSerializer(start, true)
validated, err := kubernetesAuditWebhook.emitEvent(&tt.request, "", nil)
assert.NoError(t, err)
assert.True(t, validated)
if tt.expectedEmitted {
Expand Down

0 comments on commit 673ab1a

Please sign in to comment.