fix: terminate invalid provider streams

This commit is contained in:
ajnart committed 2026-08-12 13:35:40 +02:00
1 parent 83968be07e
commit c642f9a8d3
4 files changed
+44 -3

No files matched your search

+8 -2
View File
@@ -173,8 +173,14 @@ func TestValidateProviderInput(t *testing.T) {
func TestProviderInFlightLimits(t *testing.T) {
provider := &homarrProvider{inFlightByUser: make(map[string]int)}
if !provider.acquireRequest("one") || !provider.acquireRequest("one") || provider.acquireRequest("one") {
t.Fatal("expected the per-user in-flight limit to allow two requests")
if !provider.acquireRequest("one") {
t.Fatal("expected the first user request to be admitted")
}
if !provider.acquireRequest("one") {
t.Fatal("expected the second user request to be admitted")
}
if provider.acquireRequest("one") {
t.Fatal("expected the third user request to be rejected")
}
provider.releaseRequest("one")
provider.releaseRequest("one")