Skip to content

Commit e3e0802

Browse files
committed
Fix duplicate
1 parent 36f0309 commit e3e0802

1 file changed

Lines changed: 1 addition & 36 deletions

File tree

webhook/webhook_test.go

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -366,8 +366,8 @@ func TestURLNotifierFilter(t *testing.T) {
366366
numCalled.Inc()
367367
}
368368

369-
_ = urlNotifier.QueueNotify(context.Background(), &livekit.WebhookEvent{Event: EventRoomMetadataChanged})
370369
_ = urlNotifier.QueueNotify(context.Background(), &livekit.WebhookEvent{Event: EventRoomStarted})
370+
_ = urlNotifier.QueueNotify(context.Background(), &livekit.WebhookEvent{Event: EventRoomMetadataChanged})
371371
_ = urlNotifier.QueueNotify(context.Background(), &livekit.WebhookEvent{Event: EventRoomFinished})
372372
require.Eventually(
373373
t,
@@ -733,8 +733,6 @@ func TestResourceURLNotifierLifecycle(t *testing.T) {
733733
}
734734

735735
func TestResourceURLNotifierFilter(t *testing.T) {
736-
InitWebhookStats(prometheus.Labels{})
737-
738736
s := newServer(testAddr)
739737
require.NoError(t, s.Start())
740738
defer s.Stop()
@@ -866,39 +864,6 @@ func TestResourceURLNotifierFilter(t *testing.T) {
866864
webhookCheckInterval,
867865
)
868866
})
869-
870-
t.Run("room metadata changed", func(t *testing.T) {
871-
resourceURLNotifier := NewResourceURLNotifier(ResourceURLNotifierParams{
872-
URL: testUrl,
873-
APIKey: testAPIKey,
874-
APISecret: testAPISecret,
875-
Config: ResourceURLNotifierConfig{
876-
MaxAge: 200 * time.Millisecond,
877-
MaxDepth: 50,
878-
},
879-
FilterParams: FilterParams{
880-
IncludeEvents: []string{EventRoomMetadataChanged},
881-
},
882-
})
883-
defer resourceURLNotifier.Stop(false)
884-
885-
numCalled := atomic.Int32{}
886-
s.handler = func(w http.ResponseWriter, r *http.Request) {
887-
numCalled.Inc()
888-
}
889-
890-
_ = resourceURLNotifier.QueueNotify(context.Background(), &livekit.WebhookEvent{Event: EventRoomMetadataChanged})
891-
_ = resourceURLNotifier.QueueNotify(context.Background(), &livekit.WebhookEvent{Event: EventRoomStarted})
892-
_ = resourceURLNotifier.QueueNotify(context.Background(), &livekit.WebhookEvent{Event: EventRoomFinished})
893-
require.Eventually(
894-
t,
895-
func() bool {
896-
return numCalled.Load() == 1
897-
},
898-
5*time.Second,
899-
webhookCheckInterval,
900-
)
901-
})
902867
}
903868

904869
func newTestResourceNotifier(timeout time.Duration, maxAge time.Duration, maxDepth int) *ResourceURLNotifier {

0 commit comments

Comments
 (0)