Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] Third Party Tools
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 03-07-2008, 02:13 PM
teognost teognost is online now
Registered User
 
Join Date: 05-25-2004
Location: Prague,Czech Republic
Posts: 200
Files locked by NUnit console

We are doing a couple of intraday builds.During the build unit tests are performed using nunit console but launched from NCover(in order to create coverage reports as well):
"C:\Program Files\NCover\NCover.Console.exe" "C:\Program Files\NUnit-Net-2.0 2.2.8\bin\nunit-console.exe" "ConfigMgrTests.dll" //w D:\LatestUnitTestBinaries\IntradayTrunk //a ConfigMgr //ea TranslatorGen.GeneratedTranslatorAttribute;Seriali zation.GeneratedSerializatorAttribute //l D:\Reports\NCover\2008.0307.1.0\ConfigMgrTests.dll .Coverage.log //x D:\Reports\NCover\2008.0307.1.0\ConfigMgrTests.dll .Coverage.xml /noshadow /xml:"D:\Reports\UnitTests\2008.0307.1.0\ConfigMgrT ests.dll.xml"

The command is run for all the dlls,one by one.
But after build finished-some dlls remained locked,cannot delete them so next intraday build would fail.
In Task Manager it appears the process nunit-console.exe even after build is finished.
If I kill this process manually-files are not locked anymore.
I am thinking about doing this automatically at the end of each build-determine the process ID of nunit-console.exe launched by current build and kill it.
I need to kill specific ID as it can run in the same time a branch build and I do not want to kill its nunit-console.exe which is still running...
Is there any way to do this in VBuild?
Or is there a way to kill all the processes launched inside the build process as soon as build is finished?
The build is launched with VisBuildCmd.exe.
Reply With Quote
  #2  
Old 03-07-2008, 02:26 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
You may want to open an issue with the NCover and/or NUnit vendor -- it sounds like a bug if the process doesn't exit after it has completed its task.

As far as working around the problem, once you obtain the process ID (not sure of the best way to determine which one if there are multiple), you can use the Kill Process action to kill it: http://www.visualbuild.com/Manual/killprocessaction.htm
Reply With Quote
  #3  
Old 03-07-2008, 02:36 PM
teognost teognost is online now
Registered User
 
Join Date: 05-25-2004
Location: Prague,Czech Republic
Posts: 200
Ok,so this could be a workaround if I do not get any solution from NUnit\NCover.
But I do not know how to determine the process ID.
I use for launching NUnit\NCover ->a NCover action.
Reply With Quote
  #4  
Old 03-11-2008, 04:23 AM
teognost teognost is online now
Registered User
 
Join Date: 05-25-2004
Location: Prague,Czech Republic
Posts: 200
Finally I used this workaround:
-I implemented a step calling Unlocker.exe (http://www.emptyloop.com/unlocker/) in command line with -s -o parameters.Normally this program should unlock the related folder but in my case it does not happen but it writes in a log file the process id that keeps the folder locked.Log file is located in the same folder with Unlocker.exe
-I implemented a VBScript step that would read from the log the process id
-I implemented a kill process step for the process id deterrminated in previous step.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -5. The time now is 10:44 AM.


Copyright © 1999-2023 Kinook Software, Inc.