* [PATCH] test: allow latencystat of zero
@ 2025-08-06 16:41 Stephen Hemminger
0 siblings, 0 replies; only message in thread
From: Stephen Hemminger @ 2025-08-06 16:41 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Reshma Pattan
When test is running on emulated hardware, the performance counters
(TSC) maybe emulated and return the same value. So allow a
latency of zero, even though it should not happen IRL.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
app/test/test_latencystats.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/app/test/test_latencystats.c b/app/test/test_latencystats.c
index 676a99d385..ad0237ce78 100644
--- a/app/test/test_latencystats.c
+++ b/app/test/test_latencystats.c
@@ -192,9 +192,7 @@ static int test_latency_packet_forward(void)
}
TEST_ASSERT(values[4].value > 0, "No samples taken");
- TEST_ASSERT(values[0].value > 0, "Min latency should not be zero");
- TEST_ASSERT(values[1].value > 0, "Avg latency should not be zero");
- TEST_ASSERT(values[2].value > 0, "Max latency should not be zero");
+
TEST_ASSERT(values[0].value < values[1].value, "Min latency > Avg latency");
TEST_ASSERT(values[0].value < values[2].value, "Min latency > Max latency");
TEST_ASSERT(values[1].value < values[2].value, "Avg latency > Max latency");
--
2.47.2
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-08-06 16:41 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-08-06 16:41 [PATCH] test: allow latencystat of zero Stephen Hemminger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).