On Wed, 10 Jun 2026 13:34:10 +0100, Daniel P. Berrangé <[email protected]>
wrote:
> diff --git a/tests/functional/generic/test_monitor_hotplug.py
> b/tests/functional/generic/test_monitor_hotplug.py
> index 5d8a159eb00..03087faafc3 100755
> --- a/tests/functional/generic/test_monitor_hotplug.py
> +++ b/tests/functional/generic/test_monitor_hotplug.py
> @@ -163,6 +168,63 @@ def test_events_after_negotiation(self):
> qmp.close()
> self._remove_monitor()
>
> + def stress_mon(self, sock):
> + async def main():
> + qmp = QMPClient('testvm')
> + await qmp.connect(sock)
> + # Run query-version in a tight loop so that the
> + # monitor thread/dispatcher is very busy at the
> + # time we try to delete the monitor
> + while True:
> + try:
> + # A command which returns alot of data to make
"a lot"
> [ ... skip 38 lines ... ]
> + sock = self._add_monitor()
> + print ("# stress cycle %02d/%02d" % (i, repeat))
> + stress = threading.Thread(target=self.stress_mon, args=[sock])
> + stress.start()
> + # Sleep upto 1/2 second to vary the races
> + time.sleep(random.random() / 0.5)
* 0.5 or / 2 for the intended sleep
--
Marc-André Lureau <[email protected]>