1

We are seeing our builds on TFS taking too long and investigating the reason. Then I found that in each build during test run, some tests started over 30 seconds after the last test ended. So it is wasting lots of time for each build! The pattern when the pauses occurred was very random. When I dig into the activity log in the build, I noticed this message around those breaks:

System.AppDomainUnloadedException: Attempted to access an unloaded AppDomain. This can happen if the test(s) started a thread but did not stop it. Make sure that all the threads started by the test(s) are stopped before completion.

What does this mean? Is there a way to check which test is having this issue and how to avoid it? Thanks.

bigbearzhu
  • 2,381
  • 6
  • 29
  • 44
  • 1
    This tends to happen on tests that do Async work. – jessehouwing May 19 '16 at 07:02
  • @jessehouwing Are you suggesting that tests not do async work? That doesn't seem to be a very practical resolution... For what it's worth, I've also been encountering this in my TFS builds, and it pretty much means I can't trust my build results if they sometimes fail because of this reason, and not because the logic is incorrect. – llaughlin Apr 25 '17 at 17:58
  • I mean that your async code likely can cause the same issues in production, so you need to fix it. – jessehouwing Apr 25 '17 at 18:00
  • It may help to set the thread id so you can trace it back to the test... – jessehouwing Apr 25 '17 at 18:21

0 Answers0