获取“响应代码 = 500”运行黄瓜时随机出错

发布于 2024-09-15 15:12:22 字数 850 浏览 3 评论 0原文

由于某种原因,当我运行 Cucumber 时,即使所有测试都通过了,我仍然收到 500 的响应代码。每次我运行它时,对于不同的测试,错误都会随机发生。有时所有测试也会通过。

我以为是内存问题,所以我尝试重新启动计算机,但没有任何作用。

错误的一个示例是:

And I follow "link"                                                       # features/step_definitions/web_steps.rb:33
  Failed.  Response code = 500.  Response message = Internal Server Error. (ActiveResource::ServerError)
  ./app/controllers/companies_controller.rb:23:in `show'
  ./features/step_definitions/web_steps.rb:35
  ./features/step_definitions/web_steps.rb:14:in `with_scope'
  ./features/step_definitions/web_steps.rb:34:in `/^(?:|I )follow "([^"]*)"(?: within "([^"]*)")?$/'
  features/manage_sites.feature:256:in `And I follow "link"'

它似乎与标记功能有关。我使用的是 @wip 标签,当我移动它时,它会导致零星的 500 错误。删除所有 @wip 标签将使所有测试通过。

但我可能是错的。我需要不断地尝试和复制它。

有人可以帮忙吗?

For some reason I keep getting a response code of 500 when I run cucumber, even though all the tests pass. The error occurs randomly for different tests, every time I run it. Sometimes all tests pass as well.

I thought it was a memory issue, so I tried restarting my computer, but that didn't do anything.

An example of the error is:

And I follow "link"                                                       # features/step_definitions/web_steps.rb:33
  Failed.  Response code = 500.  Response message = Internal Server Error. (ActiveResource::ServerError)
  ./app/controllers/companies_controller.rb:23:in `show'
  ./features/step_definitions/web_steps.rb:35
  ./features/step_definitions/web_steps.rb:14:in `with_scope'
  ./features/step_definitions/web_steps.rb:34:in `/^(?:|I )follow "([^"]*)"(?: within "([^"]*)")?$/'
  features/manage_sites.feature:256:in `And I follow "link"'

It seems related to the tagging feature. I was using the @wip tag, and when I moved it around, it would cause the sporadic 500 errors. Removing all @wip tags makes all the tests pass.

I could be wrong though. I'll need to try and replicate it consistently.

Would anybody be able to help?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文