https://bugs.winehq.org/show_bug.cgi?id=47800
Bug ID: 47800 Summary: Better detect Windows reboots Product: Wine-Testbot Version: unspecified Hardware: x86 OS: Linux Status: NEW Severity: normal Priority: P2 Component: unknown Assignee: wine-bugs@winehq.org Reporter: fgouget@codeweavers.com Distribution: ---
When a test crashes Windows in a VM we get typically get an error like this:
channel 2: open failed: connect failed: Connection refused channel 2: open failed: connect failed: Connection refused channel 2: open failed: connect failed: Connection refused An error occurred while waiting for the test to complete: network read got a premature EOF (wait2/connect:AgentVersion.h:0/9) The test VM has crashed, rebooted or lost connectivity (or the TestAgent server died) The previous 2 run(s) terminated abnormally
Nowadays most VMs autologin and autostart the TestAgent server with the --show-restarts option. What this does is pop up a dialog saying:
TestAgentd.exe was restarted (2). Did Windows reboot?
This is a telltale sign that Windows indeed rebooted (or that the TestBot administrator incorrectly set up the VM but then you'd see that dialog in all screenshots of that VM).
The way this works is that when given the --show-restarts option the TestAgent server increases a persistent counter every time it starts. Normally the TestBot administrator will have reset that counter so it will be set to one such that a reboot will push it to 2 prompting this dialog.
What's interesting is that this counter is accessible from the client with getproperties("start.counter"). So the WineRun*.pl script can know if the VM was indeed rebooted.
But from the log above we also notice that they don't leave enough time for the VM to reboot and thus fail to reestablish the connection to the TestAgent server. This could be solved by adding a call to SetConnectionTimeout(,,$WaitForBoot) in the strategic places.
Then in most cases the WineRun*.pl scripts could conclusively say that Windows crashed and rebooted.