mirror of
https://github.com/mudler/LocalAI.git
synced 2026-07-31 10:28:43 -04:00
Avoid holding the global loader lock across backend lifecycle waits and propagate forced shutdown through distributed workers. Track parallel requests with in-flight counters and reserve worker ports until process termination. Add focused race tests and an authoritative FizzBee lifecycle model with a fail-closed conformance target. Assisted-by: Codex:GPT-5 [FizzBee] [Ginkgo] Signed-off-by: Richard Palethorpe <io@richiejp.com>
28 lines
613 B
Go
28 lines
613 B
Go
package grpc
|
|
|
|
import (
|
|
. "github.com/onsi/ginkgo/v2"
|
|
. "github.com/onsi/gomega"
|
|
)
|
|
|
|
var _ = Describe("Client busy accounting", func() {
|
|
It("remains busy until every parallel operation completes", func() {
|
|
client := &Client{parallel: true}
|
|
|
|
client.setBusy(true)
|
|
client.setBusy(true)
|
|
client.setBusy(false)
|
|
Expect(client.IsBusy()).To(BeTrue())
|
|
|
|
client.setBusy(false)
|
|
Expect(client.IsBusy()).To(BeFalse())
|
|
})
|
|
|
|
It("does not underflow on a redundant completion", func() {
|
|
client := &Client{parallel: true}
|
|
client.setBusy(false)
|
|
client.setBusy(true)
|
|
Expect(client.IsBusy()).To(BeTrue())
|
|
})
|
|
})
|