Skip to content

🎧 Your Personal Streaming Service

fix(test): prevent flaky deadlock in throttle backlog test (#5474)

Deluan Quintão569de4cd23b4
diff --git a/server/throttle_backlog_test.go b/server/throttle_backlog_test.go
index eb181b4ce..4d8567db5 100644
--- a/server/throttle_backlog_test.go
+++ b/server/throttle_backlog_test.go
@@ -209,7 +209,7 @@ var _ = Describe("ThrottleBacklog", func() {
// runTwoRequests sends two concurrent requests through a throttled router. The
// first request holds the token until the second has been dispatched.
func runTwoRequests(m func(http.Handler) http.Handler) (firstStatus, secondStatus int) {
- held := make(chan struct{})
+ held := make(chan struct{}, 1)
release := make(chan struct{})
r := chi.NewRouter()
r.Use(m)