Skip to content

net: fix non-deterministic failures of the 'netdev-socket' qtest

Daniel P. Berrangé qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6Revert "netdev: set timeout depending on loadavg"tests/qtest/netdev-socket.c+1 -270 replies
2/6Revert "osdep: add getloadavg"include/qemu/osdep.h meson.build+0 -110 replies
3/6Revert "tests/qtest/netdev-socket: Raise connection timeout to 120 seconds"tests/qtest/netdev-socket.c+1 -10 replies
4/6net: add explicit info about connecting/listening statenet/stream.c tests/qtest/netdev-socket.c+9 -60 replies
5/6net: handle QIOTask completion to report useful error messagenet/stream.c+10 -50 replies
6/6qtest: ensure netdev-socket tests have non-overlapping namestests/qtest/netdev-socket.c+1 -11 reply

Reviews trailers per patch

1 of 6 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchStefan HajnocziPhilippe Mathieu-Daudé
SeriesR-b
1/6
2/6
3/6
4/6
5/6
6/6R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/6] net: fix non-deterministic failures of the 'netdev-socket' qtest

We've previously bumped up the timeouts in the netdev-socket qtest to supposedly fix non-deterministic failures, however, the failures are still hitting CI.

A simple 'listen()' and 'connect()' pairing across 2 QEMU processes should be very quick to execute, even under high system load, so it was never likely that the test was failing due to timeouts being reached.

The actual root cause was a race condition in the test design. It was spawning a QEMU with a 'server' netdev, and then spawning one with the 'client' netdev. There was insufficient synchronization, however, so it was possible for the 2nd QEMU process to attempt to 'connect()' before the 'listen()' call was made by the 1st QEMU.

In the test scenarios that did not use the 'reconnect' flag, this would result in the client QEMU never getting into the expected state. The test code would thus loop on 'info network' until hitting the maximum wait time.

This series reverts the increased timeouts, and fixes synchronization in the test scenarios. It also improves reporting of errors in the socket netdev backend so that 'info network' reports what actually went wrong rather than a useless generic 'connection error' string. This will help us diagnose any future CI problems, should they occurr.

Daniel P. Berrangé (6):
Revert "netdev: set timeout depending on loadavg" Revert "osdep: add getloadavg"
Revert "tests/qtest/netdev-socket: Raise connection timeout to 120
seconds"
net: add explicit info about connecting/listening state
net: handle QIOTask completion to report useful error message
qtest: ensure netdev-socket tests have non-overlapping names

 include/qemu/osdep.h        | 10 ---------
 meson.build                 |  1 -
 net/stream.c                | 18 +++++++++++-----
 tests/qtest/netdev-socket.c | 42 +++++++------------------------------
 4 files changed, 21 insertions(+), 50 deletions(-)
Signature · 1 line
2.43.0