Hi, thanks for posting!
Quote:
As you can see ASKVISION has just started building when all the other Grid Nodes already has completed all tasks. Why is ASKVISION not stopped when everything else is completed? And why does each Grid Node build everything and not only the parts dependend from the test projects the Grid Node is assigned to test?
It looks to me like ASKVISION is performing an extensive synchronisation with the grid client at the start of the run. Each grid node has on it a number of stored snapshots representing solutions that have been previously transferred from grid clients over to the server for processing. These snapshots are retained between sessions, so that once the files have been copied over, it's less likely that they'll need to be copied again.
The management of snapshots on a grid node is a complex thing. This is because solutions can often undergo large changes (i.e. branch switches), and grid nodes are often also shared by multiple grid clients. Sometimes it becomes necessary to create a new snapshot on a grid node when a client connects, because no suitable existing snapshot is available to service the client. This can result in a lengthy synchronisation involving many files being copied or transferred between snapshots on the grid node.
So it's quite possible that you won't see this again. If you do, it may be that your
solution storage data limit is set too low on the grid node.
Regarding the building of projects on each node, this is due to the design of the distributed processing. NCrunch cannot run tests without having first built all projects required in the runtime environment. This means that build tasks are duplicated over the grid, with each node responsible for building its own artifacts.
It is technically possible for such artifacts to be built on only one machine and then be transferred to others (thereby reducing resource requirements), but such a system comes with its own complexities and limitations. We have not yet implemented anything like this in NCrunch's distributed processing. So you'll generally find you get better results when using bigger chunkier grid nodes as opposed to a larger number of small nodes.
When NCrunch chooses which projects to build, it will automatically build all projects in the solution regardless of which ones contain tests. This is for two reasons:
1. It is difficult to know which projects actually contain tests without having a compiled assembly to interrogate. The discovery of tests is dependent on a project first being built.
2. Although it is used primarily as a test runner, NCrunch is also a build tool. If you have a project in your solution that fails to build, NCrunch will report the failure.
It's possible to exclude certain projects from being built on grid nodes by using the
capabilities system. If you have projects in your solution that are not required for execution of your tests and you aren't interested in seeing the results of their build in the NCrunch output, excluding them using capabilities will improve the performance of your build. Another option would be creating a different solution file that contains only your test projects and using this for the target of the NCrunch console tool run.
Edit: I've also just noticed that the build tasks on ASKVISION took much longer to run than on the other nodes. How does the hardware of this machine compare to the other machines in your grid? Is it possible the machine was tied up with some kind of system related task? We've personally experienced some issues like this with Windows Defender.
Another Edit: You have a very good an valid question of why the run wasn't terminated when all the tests had finished executing. The honest answer is that when using NCrunch inside VS, you wouldn't want this to happen because you'd likely still be making changes and new tests would need to be executed. Under a CI scenario, you would want the run to terminate as early as possible. We haven't implemented such a consideration into the console tool yet (which is basically just a headless client). Probably it's something we should look at :)