mirror of
https://github.com/mudler/LocalAI.git
synced 2026-09-15 15:52:31 -04:00
fix(distributed): restore node liveness tests (#11694)
* fix(distributed): restore node liveness tests The router now probes models.running before it schedules work. The E2E workers only mocked backend.install, so every test node appeared offline. The endpoint test double also missed the new PingNode method and stopped the Linux, Apple, and lint jobs during compilation. Mock the existing worker reply in both distributed fixtures and keep the endpoint test double aligned with NodeCommandSender. Assisted-by: Codex:gpt-5 [golangci-lint] * fix(tests): check node liveness replies The liveness test subscriptions ignored setup and reply errors. Errcheck rejected each branch that carried them. Assisted-by: Codex:gpt-5 [golangci-lint] --------- Co-authored-by: localai-org-maint-bot <306269227+localai-org-maint-bot@users.noreply.github.com>
This commit is contained in:
1 parent
a8bc64cd09
commit
7ff9d9942b
2 files changed
+12
No files matched your search
@@ -260,6 +260,12 @@ var _ = Describe("Full Distributed Inference Flow", Label("Distributed"), func()
|
||||
data, _ := json.Marshal(reply)
|
||||
msg.Respond(data)
|
||||
})
|
||||
_, err := infra.NC.Conn().Subscribe("nodes.*.models.running", func(msg *nats.Msg) {
|
||||
data, _ := json.Marshal(messaging.ModelsRunningReply{})
|
||||
_ = msg.Respond(data)
|
||||
})
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
FlushNATS(infra.NC)
|
||||
|
||||
return router
|
||||
}
|
||||
|
||||
@@ -66,6 +66,12 @@ var _ = Describe("SmartRouter trackingKey", Label("Distributed"), func() {
|
||||
data, _ := json.Marshal(reply)
|
||||
msg.Respond(data)
|
||||
})
|
||||
_, err = infra.NC.Conn().Subscribe("nodes.*.models.running", func(msg *nats.Msg) {
|
||||
data, _ := json.Marshal(messaging.ModelsRunningReply{})
|
||||
_ = msg.Respond(data)
|
||||
})
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
FlushNATS(infra.NC)
|
||||
|
||||
// Start a mock gRPC backend using the same helper as full flow tests
|
||||
llm := &trackingTestLLM{}
|
||||
|
||||
Reference in new issue
Block a user