]> xenbits.xensource.com Git - people/aperard/xen-unstable.git/commitdiff
automation: fix race condition in adl-suspend test
authorMarek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Tue, 31 Oct 2023 02:16:53 +0000 (03:16 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 31 Oct 2023 11:06:16 +0000 (11:06 +0000)
If system suspends too quickly, the message for the test controller to
wake up the system may be not sent to the console before suspending.
This will cause the test to timeout.

Fix this by calling sync on the console and waiting a bit after printing
the message. The test controller then resumes the system 30s after the
message, so as long as the delay + suspending takes less time it is
okay.

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Release-acked-by: Henry Wang <Henry.Wang@arm.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
(cherry picked from commit df43b54590e10b6199e44741b453fcbae2b06d25)

automation/scripts/qubes-x86-64.sh

index f5dae823589a79323967d989021cd6d6c5a2fbcd..51323b1ae0403338f740446351f605f3abe22516 100755 (executable)
@@ -54,11 +54,12 @@ until grep 'domU started' /var/log/xen/console/guest-domU.log; do
     sleep 1
 done
 echo \"${wait_and_wakeup}\"
+# let the above message flow to console, then suspend
+sync /dev/stdout
+sleep 5
 set -x
 echo deep > /sys/power/mem_sleep
 echo mem > /sys/power/state
-# now wait for resume
-sleep 5
 xl list
 xl dmesg | grep 'Finishing wakeup from ACPI S3 state' || exit 1
 # check if domU is still alive