fix: terminate invalid provider streams
This commit is contained in:
1 parent
83968be07e
commit
c642f9a8d3
4 files changed
+44
-3
No files matched your search
@@ -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")
|
||||
|
||||
Reference in new issue
Block a user