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())