We're seeing this behavior occasionally with TeamCity 6.0.1 where it seems to lock junit files for use.
In our build step, we're using the XML reporting option, specifying junit and having these as the parameters:
This is because TeamCity cannot detect these junit results using its normal mechanism so we need to specify them. At the start of the next build, we try to remove the ClearCase view which is located at %system.dxsi.view.pname% but we're unable to do so because the TeamCity agent still has some files in use:
D:\views\bsmith_dx_8.5_tc>rd /s/q vobs_dx_qa
vobs_dx_qa\si\target\docs\junit\data\eclipse\TEST-com.progress.dataxtend.si.ui.compare.adapter.TestResourceDiffNodeInput.xml - The process cannot access the file because it is being used by another process.
vobs_dx_qa\si\target\docs\junit\data\eclipse\TEST-com.progress.dataxtend.si.ui.views.TestDeleteAnalysisView.xml - The process cannot access the file because it is being used by another process.
Using NT SysInternal tools (handle.exe), I'm able to determine that it's the TeamCity agent process that is doing this. This seems like a bug to me.
Any thoughts on how we can track down this defect?
I'm going to try to implement a workaround where I copy the junit results directory to the %system.teamcity.build.tempDir% directory and change the junit xml reporting to use this instead so it won't hold onto file handles when a new build tries to delete the view.