Skip to content

Commit 343b0ab

Browse files
committed
test(network_latency): drop check on number of pings returned
test_network_latency uses ping to send 15 rounds of 30 pings from the guest to the host and collects the latencies printed. For this, instead of just parsing the ping output for however many lines of latency data there we, implicitly assert that we get exactly 30. However, sometimes this fails. Nikita and Egor investigated and found that no packages are lost, sometimes ping just seems to not print all 30 lines for some reason (presumably a bug in ping). So just drop this assertion to stop spurious test failures from happening. This is a performance test, not a functional test anyway. Signed-off-by: Patrick Roy <[email protected]>
1 parent 7dfe276 commit 343b0ab

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tests/integration_tests/performance/test_network.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from framework.utils_iperf import IPerf3Test, emit_iperf3_metrics
1212

1313

14-
def consume_ping_output(ping_putput, request_per_round):
14+
def consume_ping_output(ping_putput):
1515
"""Consume ping output.
1616
1717
Output example:
@@ -29,12 +29,12 @@ def consume_ping_output(ping_putput, request_per_round):
2929
assert len(output) > 2
3030

3131
# Compute percentiles.
32-
seqs = output[1 : request_per_round + 1]
3332
pattern_time = ".+ bytes from .+: icmp_seq=.+ ttl=.+ time=(.+) ms"
34-
for seq in seqs:
33+
for seq in output:
3534
time = re.findall(pattern_time, seq)
36-
assert len(time) == 1
37-
yield float(time[0])
35+
if time:
36+
assert len(time) == 1
37+
yield float(time[0])
3838

3939

4040
@pytest.fixture
@@ -81,7 +81,7 @@ def test_network_latency(network_microvm, metrics):
8181
f"ping -c {request_per_round} -i {delay} {host_ip}"
8282
)
8383

84-
samples.extend(consume_ping_output(ping_output, request_per_round))
84+
samples.extend(consume_ping_output(ping_output))
8585

8686
for sample in samples:
8787
metrics.put_metric("ping_latency", sample, "Milliseconds")

0 commit comments

Comments
 (0)