2014-03-31 33 views
3

我試圖創建測試與codeception,將檢查的頁面正常工作在高負載的情況下。如何更改codeception phpbrowser /水貂超時

不幸的是,如果該頁面是非常非常高負荷測試開始我得到了這樣的錯誤:

[..] 
[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 
[..] 

是否有可能設置水貂超時一些更高的價值?

回答

1

您可以通過您的測試套裝配置設置捲曲選項,就像在Codeception文檔中的example一樣。

在你的情況,你需要CURLOPT_TIMEOUT,看到curl_setopt reference

modules: 
    enabled: [PhpBrowser] 
     config: 
     PhpBrowser: 
      url: 'http://localhost' 
      curl: 
      CURLOPT_TIMEOUT: 50000 # timeout in seconds 
+2

CURLOPT_TIMEOUT單位是秒。對於MS使用CURLOPT_TIMEOUT_MS –

+0

@EdSullivan修復,謝謝! –

+2

我的代碼完全忽略了這個設置,並在30秒後仍然超時。 –

0

這涉及到以下職位:Codeception ignores CURLOPT_TIMEOUT

有一個codeception錯誤,防止被設置這個值。使用最新版本的codeception,> = 2.0.15,您可以傳遞CURLOPT_TIMEOUT_MS來完成您正在嘗試執行的操作。