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
…32242)

Signed-off-by: Wassim DHIF <[email protected]>
  • Loading branch information
wdhif authored Dec 24, 2024
1 parent 45b38f9 commit f8da8a4
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 f8da8a4

Please sign in to comment.