I am trying to execute dotnet test
from the command line on our Jenkins build server, but it just hangs on:
Starting test execution, please wait...
The versioning was a red herring and it turned out to be much simpler problem. My tests were testing Async controller methods, and my non-async tests were doing:
var result = controller.PostAsync(request).Result;
as soon as I changed the tests themselves to use the async/await pattern they worked fine:
var result = await controller.PostAsync(request);
Something that helped me diagnose the issue was using the dotnet test --verbosity d
argument. When using this it was outputting some tests that were passing rather than just "Starting test execution, please wait". Interestingly every time I run the command it would execute a different number of tests before appearing to get stuck. This suggested there was perhaps some sort of thread deadlock issue which led me to the solution. I'm still unsure why the command ran fine on my local machine but not our Jenkins slave.