From dd378fa693c6451f47a1de5430c41b62950fd286 Mon Sep 17 00:00:00 2001 From: irar2 Date: Sun, 26 Oct 2025 08:36:41 +0200 Subject: [PATCH] Test fix: allow number of running requests to be 999 Signed-off-by: irar2 --- pkg/llm-d-inference-sim/worker_test.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/pkg/llm-d-inference-sim/worker_test.go b/pkg/llm-d-inference-sim/worker_test.go index 8d2c612d..bec8bcb6 100644 --- a/pkg/llm-d-inference-sim/worker_test.go +++ b/pkg/llm-d-inference-sim/worker_test.go @@ -411,12 +411,14 @@ var _ = Describe("Simulator requests scheduling", Ordered, func() { // We sent 2500 requests, after about 2.5 seconds // number of running requests should be 1000 - // and the number of waiting requests should be less than 1000 + // and the number of waiting requests should be less than 1000. + // Since we are in the middle of requests scheduling, + // the number of running requests can be 999. runningStr = findMetric(metrics, runningMetric) Expect(runningStr).NotTo(Equal("")) running, err = strconv.Atoi(runningStr) Expect(err).NotTo(HaveOccurred()) - Expect(running).To(Equal(1000)) + Expect(running).To(Or(Equal(1000), Equal(999))) waitingStr = findMetric(metrics, waitingMetric) waiting, err = strconv.Atoi(waitingStr) Expect(err).NotTo(HaveOccurred()) @@ -431,13 +433,15 @@ var _ = Describe("Simulator requests scheduling", Ordered, func() { Expect(err).NotTo(HaveOccurred()) metrics = strings.Split(string(data), "\n") - // number of running requests should be 1000 - // and the number of waiting requests should be less than 1000 + // The number of running requests should be 1000 + // and the number of waiting requests should be less than 1000. + // Since we are in the middle of requests scheduling, + // the number of running requests can be 999. runningStr = findMetric(metrics, runningMetric) Expect(runningStr).NotTo(Equal("")) running, err = strconv.Atoi(runningStr) Expect(err).NotTo(HaveOccurred()) - Expect(running).To(Equal(1000)) + Expect(running).To(Or(Equal(1000), Equal(999))) waitingStr = findMetric(metrics, waitingMetric) waiting, err = strconv.Atoi(waitingStr) Expect(err).NotTo(HaveOccurred())