I'm using NCrunch v2.4.0.2 with the engine mode of "Run all tests automatically."
When making changes to the code, I see that NCrunch is processing a build, but for some reason it takes a long time to complete. Even changing a small piece of code, such as adding a space, results in a lengthy wait for the test to be run.
The duration of the wait can be in the ballpark of 1 - 2mins.
Likely I may have a setting which needs to be changed, but I'm not sure where to begin. Any advise would be much appreciated.
Thanks.
Jason.
Sorry, I just realised I posted this in the wrong forum, should have been in the "Build/Test Issues" section.
Remco NCrunch Developer
#5412
26 Feb 2014 23:36 UTC
Hi, thanks for sharing this issue.
The first thing to confirm is which project is responsible for the long build time. I recommend watching the processing queue when you make a change. Is there a particular project that takes a long time to build compared with others?
If you have a project that consists of many included files (for example, if you've used the 'Additional files to include' configuration setting with a very broad wildcard), then NCrunch will have much more work to do when it first creates the workspaces for the project. This is because NCrunch needs to build several shadow projects inside a separate area of your disk, copying everything into this location from your foreground project. After the engine has been running for a while, it will have set up enough workspaces to support the level of concurrency you have configured it to use, and the build times should improve.
Something else to watch out for is custom build steps that take a long time. MSFakes and Code Contracts are known to greatly increase build times. Are you using either of these frameworks or any other tools that may have an impact here? How long does your solution normally take to build if you run a full Rebuild after a Clean?
The first thing to confirm is which project is responsible for the long build time. I recommend watching the processing queue when you make a change. Is there a particular project that takes a long time to build compared with others?
If you have a project that consists of many included files (for example, if you've used the 'Additional files to include' configuration setting with a very broad wildcard), then NCrunch will have much more work to do when it first creates the workspaces for the project. This is because NCrunch needs to build several shadow projects inside a separate area of your disk, copying everything into this location from your foreground project. After the engine has been running for a while, it will have set up enough workspaces to support the level of concurrency you have configured it to use, and the build times should improve.
Something else to watch out for is custom build steps that take a long time. MSFakes and Code Contracts are known to greatly increase build times. Are you using either of these frameworks or any other tools that may have an impact here? How long does your solution normally take to build if you run a full Rebuild after a Clean?
Hiya.
I created a fresh unit test project, with one test, which had a reference to a class library project. All was fine, NCrunch did not take long at all to process the build.
When I added a fakes assembly, and did the tests again, there was a bit of a delay, but not close to the length of the other solution where I experienced the lengthy waiting. I will keep an eye on this, but it could be my other solution is a one-off, in that there is something about it that causes the delay. It's not a complicated solution at all, but it could be Fakes related that it takes so long to run.
Cheers.
Jason.
I created a fresh unit test project, with one test, which had a reference to a class library project. All was fine, NCrunch did not take long at all to process the build.
When I added a fakes assembly, and did the tests again, there was a bit of a delay, but not close to the length of the other solution where I experienced the lengthy waiting. I will keep an eye on this, but it could be my other solution is a one-off, in that there is something about it that causes the delay. It's not a complicated solution at all, but it could be Fakes related that it takes so long to run.
Cheers.
Jason.
Remco NCrunch Developer
#5425
27 Feb 2014 22:42 UTC
Hi Jason -
Aaron Job has a useful article that you might want to have a look at - http://blog.gravypower.net/ncrunch-sharepoint-and-microsoft-fakes/.
Basically, there is a way you can improve the performance of NCrunch with MSFakes. Give it a try and see if it helps!
Cheers,
Remco
Aaron Job has a useful article that you might want to have a look at - http://blog.gravypower.net/ncrunch-sharepoint-and-microsoft-fakes/.
Basically, there is a way you can improve the performance of NCrunch with MSFakes. Give it a try and see if it helps!
Cheers,
Remco
Excellent.
Following the tip in that article looks to have done the trick, The build process is much quicker.
Many thanks. :)
Jason.
Following the tip in that article looks to have done the trick, The build process is much quicker.
Many thanks. :)
Jason.
Post a reply
Log in to reply.