CruiseControl doesn't stop vmware when it kills the test?

Jan 28, 2011 at 5:23 PM

I had the default CruiseControl timeout of 10 minutes set and when CruiseControl timed-out, it appears to have left both my VMs running.  Will they eventually stop when the test finishes?  I assume no because CC killed RemoteInstall and there's nothing left to tell my VMs to quit running.  Is there a work-around for this issue (besides upping the timeout, which I am also doing).

Jan 28, 2011 at 5:42 PM

I am going to write a script that does vmrun list and then vmrun stop on all vms.  I plan on inserting this script as a pre-requisit to running the tests and also I hope to add it as an action that runs when a run is aborted or killed via time-out or other failure.  I will post my results here.

Coordinator
Jan 28, 2011 at 7:05 PM

You're correct. We bump the timeout to 24 hours since most of our tests run overnight. 

Jan 28, 2011 at 9:40 PM

I setup this powershell script to run as a <prebuild> task and as a conditional publisher that is run on failure.  This ensures that we're all clean for the next run even if CC.net kills RemoteInstall.

$vmrun = "C:\Program Files (x86)\VMware\VMware Workstation\vmrun.exe";
$result = &$vmrun "list";
#echo $result

foreach ($line in $result) { 
	if ($line -ne "Total running VMs: 0")
	{
		#if line is a valid path
		if (Test-Path $line)
		{
			Write-Host "Stopping $line";
			$stop = &$vmrun "stop" $line;
		}
	}
}