Forum Discussion
1. We're running theentire Project Suite on the Master and it runs the test scripts on the Slave.
2. Yes. It is atthe bottom of this posting
3. No. We only want to reboot after a timeout has occurred, not every time.
4. The application itself is being run on the Slave.
5. No, the timeout is handled on the master.
It seems to be a race condition. We kill the application on the slave and reboot the slave. Sometimes the test item running on the slave can detect an error (like object not found), stop it's execution, and report its status to the master before the reboot occurs, and sometimes it does not.
We need a way to gracefully ensure the test item running on the slave always reports its status before the reboot.
I have been instructed to raise the priority of this problem (by calling SmartBear and talking to Paul) because this issue is preventing delivery to a customer.
=================================================================
Function RebootSlaveHost()
Dim sFcnName, iTimeout, sShellCmd, iDelay, slaveAddr, sHostCommCheck
sFcnName = "RebootSlaveHost"
Indicator.PushText(sFcnName)
' Reboot the Slave
'shutdown /r /m \\192.168.0.117 /t 5
iTimeout = 10
Log.Message("Shutdown and restart slave at " & aqDateTime.Now())
sShellCmd = "c:\windows\system32\shutdown.exe /r" _
& " /m \\" & ProjectSuite.Variables.sRemoteHostAddress _
& " /t " & iTimeout _
& " /f"
Log.Message("Shell command string: " & sShellCmd)
Dim WshShellObj, WshShellExecObj, out
Set WshShellObj = CreateObject("WScript.Shell")
Set WshShellExecObj = WshShellObj.Exec("cmd.exe")
out = readUntilChar(WshShellExecObj, ">")
Log.Message (out)
WshShellExecObj.StdIn.Write(sShellCmd + VbCrLf)
out = readUntilChar(WshShellExecObj, ">")
Log.Message (out)
'Wait for the Test Slave to shut down
' Check to see if the named host is still available
' Loop until it becomes unavailable
iDelay = 5000
slaveAddr = ProjectSuite.Variables.sRemoteHostAddress
sHostCommCheck = IsHostAvailable(slaveAddr)
dim i
i = 0
While sHostCommCheck=True
aqUtils.Delay(iDelay)
Log.Message("Test Slave has not yet shut down. Will retry in " & iDelay/1000 & " seconds.")
sHostCommCheck = IsHostAvailable(slaveAddr)
' Ping the slave for 55 seconds to check if reboot has occured, if not set Error
i = i + 1
if i > 10 then
SetCriticalFailure("Slave host has not shutdown after 55 seconds")
Exit Function
End if
Wend
Log.Message("Test Slave has been shut down. Continuing with Automated Test.")
Indicator.PopText()
End Function