Why are tests taking longer to run in TeamCity than when run directly in NUnit?

核能气质少年 提交于 2020-01-14 07:36:10

问题


I have some C# performance tests, basically running two different methods and checking that one runs much faster than the other.

When I run them locally in NUnit, one of the tests runs ten times as fast as the other, so I've got an NUnit test that uses Stopwatch to check that it is at least twice as fast (in case of regression). But when I run the tests in TeamCity, the fast method is only about 1.5 times as fast as the slow one? I would expect hardware differences to have some effect, but not this much. What could be causing this?


回答1:


To answer my own question, the problem turned out to be that code coverage was turned on for the test build in TeamCity, so the overhead of this brought the two method runtimes closer together. Hopefully this answer helps someone else in future.



来源:https://stackoverflow.com/questions/8884168/why-are-tests-taking-longer-to-run-in-teamcity-than-when-run-directly-in-nunit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!