3

我正在尝试使用 codeception 创建测试,以检查页面在高负载的情况下是否正常工作。

不幸的是,如果页面负载非常高并且测试开始,我会收到这样的错误:

[..] 
[Codeception\Exception\ModuleConfig]
Codeception\Util\Mink module is not configured!
Provided URL can't be accessed by this driver.[curl] 28: Operation timed out after 30031
milliseconds with 0 out of -1 bytes received [url] http://xxxx.xxx/app_db2.php
[..]

是否有可能将 Mink 超时设置为更高的值?

4

2 回答 2

1

您可以通过测试套件配置设置 curl 选项,就像Codeception 文档中的示例一样。

在您的情况下,您需要 CURLOPT_TIMEOUT,请参阅curl_setopt 参考

modules: 
    enabled: [PhpBrowser]  
      config:
        PhpBrowser:
          url: 'http://localhost' 
          curl:
            CURLOPT_TIMEOUT: 50000 # timeout in seconds
于 2014-03-31T14:47:01.110 回答
0

这与以下帖子有关:Codeception ignores CURLOPT_TIMEOUT

有一个代码接收错误会阻止设置此值。使用最新版本的代码接收 >=2.0.15,您可以通过 CURLOPT_TIMEOUT_MS 来完成您正在尝试做的事情。

于 2016-03-13T17:31:59.983 回答