蝗虫负载测试“不安全”地点

发布于 2025-01-23 06:49:16 字数 251 浏览 3 评论 0 原文

我想测试一个用API的网站,即在此开发阶段被归类为“不安全”。 在蝗虫文档中说:

安全模式: HTTP客户端被配置为在Safe_mode中运行。这样做的是,由于连接错误,超时或类似原因而失败的任何请求都不会引起异常,而是返回一个空虚拟响应对象。该请求将报告为用户统计信息失败。返回的虚拟响应的内容属性将设置为无,其状态_code为0。

我想知道是否有一种配置使您禁用此选项。

谢谢你的宝贵时间

I would like to test a site with APIs that at this stage of development is classified as "not secure".
In the Locust documentation is said that:

Safe mode:
The HTTP client is configured to run in safe_mode. What this does is that any request that fails due to a connection error, timeout, or similar will not raise an exception, but rather return an empty dummy Response object. The request will be reported as a failure in User’s statistics. The returned dummy Response’s content attribute will be set to None, and its status_code will be 0.

I would like to know if there is a configuration that let you disable this option.

Thank you for your time

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

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

发布评论

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

评论(1

有深☉意 2025-01-30 06:49:16

safe_mode 与SSL/TLS无关,它是指请求在请求失败时不会引发异常(出于何种原因)。

要使HTTPUSER/请求忽略SSL问题,请将 verify = false 添加到您的呼叫中。

-

您正在寻找一个非常古老的蝗虫文档,对吗?我不认为您提到的文字已经有一段时间了。

safe_mode 已从 request 中删除(它过去看起来像 https://github.com/psf/requests/pull/604 )但是,locust在这里实现了相同的行为https://github.com/locustio/locust/blob/51b1d5038a2be6e2823b2576c4436f2ff9f7c7c2/locust/clients.py#L195

safe_mode has nothing to do with SSL/TLS, it refers to requests not throwing an exception when the request fails (for whatever reason).

To make HttpUser/requests ignore SSL issues, add verify=False to your call.

——

You're looking at a very old Locust documentation, right? I dont think the text you mention has been there for quite a while.

safe_mode has been removed from requests (it used to look like this https://github.com/psf/requests/pull/604) but the same behaviour is implemented by Locust here https://github.com/locustio/locust/blob/51b1d5038a2be6e2823b2576c4436f2ff9f7c7c2/locust/clients.py#L195

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