问题
I'm trying to create test with codeception that will check's the page is properly working in case of high load.
Unfortunately if the page is in very very high load and the tests starts I got such error:
[..]
[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
[..]
Is there any possibility to set the Mink timeout to some higher value ?
回答1:
You can set curl options via your test suit configuration just like in example in Codeception docs.
In your case you need CURLOPT_TIMEOUT, see curl_setopt reference
modules:
enabled: [PhpBrowser]
config:
PhpBrowser:
url: 'http://localhost'
curl:
CURLOPT_TIMEOUT: 50000 # timeout in seconds
回答2:
This is related to the following post: Codeception ignores CURLOPT_TIMEOUT
There is a codeception bug that prevents this value from being set. With more recent versions of codeception, >=2.0.15, you can pass CURLOPT_TIMEOUT_MS to accomplish what you are trying to do.
来源:https://stackoverflow.com/questions/22757141/how-to-change-codeception-phpbrowser-mink-timeout