如何检查测试套件在一种环境中运行速度慢得多的原因

发布于 2024-10-03 00:15:39 字数 222 浏览 4 评论 0原文

我们已经配置了 teamCity,在其上运行我们的构建进行测试。问题是,当我们在 TeamCity 上运行时,有几个测试用例(谈论一个具有 5-15 个测试方法的特定类)几乎需要 45 分钟。

我一直在尝试在本地计算机上测试相同的案例,并且它们不会花费超过 6-7 分钟。

你们能否建议我最佳实践,以帮助我找出这些测试用例的可能原因?现在我将日志语句放在每个带有时间戳的地方。我还有什么可以做的吗?

We have configured teamCity on which we run our builds for testing. The problem is, there are couple of testcases (talking about one particular class having 5-15 test methods) which take almost 45 min when we run on TeamCity.

I have been trying to test the same cases on local machine and they don't take more than 6-7 min.

Could you guys suggest me the best practices which can help me figuring out what could be possible reason of these test cases? Right now I am putting log statements every where with timestamps. Is there anything else that I can do?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

网名女生简单气质 2024-10-10 00:15:39

我想看看这两个环境之间是否有区别以及有什么区别:

  • 它是相同的操作系统和文件系统吗?
  • 机器的CPU负载是多少?
  • 机器的 I/O 负载是多少?
  • 系统日志中是否显示某些内容,例如(网络或身份验证)超时可能会导致性能极度下降
  • 测试用例是否使用可能与慢速机器所在位置具有不同访问路径的外部资源(例如数据库、网络)?
  • TeamCity 在每次测试后是否会生成大量报告,这可能是缓慢的原因?也许这不是实际的测试用例执行,而是在测试之间或测试之后执行的另一个操作。
  • TeamCity 环境是否执行任何未在本地执行的设置或拆卸功能?例如建立一个测试数据库或修剪现有的测试数据库?
  • 慢速机器是集群构建服务器,必须通过主从服务器之间的线路进行通信吗?测试是在主机上还是在从机上执行?

另外,您是否也在 TeamCity 中本地运行测试用例?

I'd see if and what the difference are between the two environments:

  • Is it the same operating system and filesystem?
  • What is the CPU load of the machine?
  • What is the I/O load of the machine?
  • Does something show up in the syslog, e.g. a (network or authentication) timeout may lead to extremely decreased performance
  • Do the test cases use external resources (e.g. databases, network) which may have different access paths from where the slow machine is located?
  • Does TeamCity produce extensive reports after each test, which may be what is slow? Perhaps it's not the actual testcase execution, but another operation which is performed in between tests or after tests.
  • Does the TeamCity environment perform any setup or teardown functionality which is not executed locally? Such as building up a test database or pruning an existing testing database?
  • Is the slow machine a clustered build server which has to communicate over the wire between master and slaves? Is the testing executed on the master or the slave?

Also, do you run the test cases locally also in TeamCity?

枫以 2024-10-10 00:15:39

我之前使用过 YJP(yourkit java profiler)来分析应用程序。我认为在他们让你购买许可证之前的前 15 天左右是免费的。

I've used YJP (yourkit java profiler) to profile applications before. I think it is free for the first 15 days or so before they make you buy a license.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文