Skip to contentSkip to conversation

test: allow latencystat of zero

PATCH In review Stephen Hemminger 2 participants 2 messages Aug 6, 2025 – Feb 16

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 test: allow latencystat of zero

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.

---
 app/test/test_latencystats.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
app/test/test_latencystats.c +1 -3
index 676a99d385..ad0237ce78 100644
@@ -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");
Signature · 1 line
2.47.2
#1 lore raw
Quoted 6 lines · Stephen Hemminger

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.

That should avoid the false positive we see frequently in OBS. Applied, thanks.

Signature · 1 line
David Marchand