Skip to content

Commit 4b682e8

Browse files
committed
chore: check for packet loss in ping latency test
Check how much packets were received and allow 1 of them to be lost. This prevents intermittent failures in this test. Signed-off-by: Egor Lazarchuk <[email protected]>
1 parent 00085d3 commit 4b682e8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/integration_tests/performance/test_network_ab.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,12 @@ def consume_ping_output(ping_putput, request_per_round):
2727
assert len(output) > 2
2828

2929
# Compute percentiles.
30-
seqs = output[1 : request_per_round + 1]
30+
31+
pattern_received = ".+ packets transmitted, (.+) received, .*"
32+
received = int(re.findall(pattern_received, output[-2])[0])
33+
assert request_per_round - 1 <= received, "Lost more than 1 packet during ping"
34+
35+
seqs = output[1 : received + 1]
3136
pattern_time = ".+ bytes from .+: icmp_seq=.+ ttl=.+ time=(.+) ms"
3237
for seq in seqs:
3338
time = re.findall(pattern_time, seq)

0 commit comments

Comments
 (0)