From 7ff9d9942b12674cc033db04509a1078a3e1da06 Mon Sep 17 00:00:00 2001 From: localai-org-maint-bot Date: Mon, 24 Aug 2026 09:32:48 +0200 Subject: [PATCH] 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> --- tests/e2e/distributed/distributed_full_flow_test.go | 6 ++++++ tests/e2e/distributed/router_tracking_test.go | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/tests/e2e/distributed/distributed_full_flow_test.go b/tests/e2e/distributed/distributed_full_flow_test.go index 5eb9ff442..ad7f2669a 100644 --- a/tests/e2e/distributed/distributed_full_flow_test.go +++ b/tests/e2e/distributed/distributed_full_flow_test.go @@ -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 } diff --git a/tests/e2e/distributed/router_tracking_test.go b/tests/e2e/distributed/router_tracking_test.go index 9691b31b0..75895a372 100644 --- a/tests/e2e/distributed/router_tracking_test.go +++ b/tests/e2e/distributed/router_tracking_test.go @@ -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{}