Codeception REST timeout issue

拈花ヽ惹草 提交于 2019-12-12 04:30:55

问题


I'm trying to increase the Codeception REST timeout, but it doesn't seem to be working.

That's what I have

class_name: ApiTester
modules:
    enabled:
        - \Helper\Api:
        - REST:
            depends: PhpBrowser
            timeout: 90

Timeout error I'm getting

[GuzzleHttp\Exception\ConnectException] cURL error 28: Operation timed out after 30001 milliseconds with 0 bytes received

What am I doing wrong?


回答1:


I had this problem too. This was my Fix

in acceptance.suite.yml

    # Codeception Test Suite Configuration

# suite for acceptance tests.
# perform tests in browser using the WebDriver or PhpBrowser.
# If you need both WebDriver and PHPBrowser tests - create a separate suite.

class_name: AcceptanceTester
modules:
    enabled:
        - PhpBrowser
        - REST
    config:
        REST:
            timeout: 90 # or 90000 the same result
        PhpBrowser:
            url: 'http://YOUR_URL_TO_YOUR_PUBLIC_FOLDER/public'
            curl:
                CURLOPT_TIMEOUT: 300 // in Seconds

My problem was that i put only the REST in it with "depends" to PhpBrowser but you need to configure the PhpBrowser to setup the Timeout.

I hope i could help and sorry for my bad english :)

Kind Regards, Thomas Meejumlong




回答2:


Thanks Thomas, I've added this to my api.suite.yml file and it worked.

class_name: ApiTester modules: enabled: - \Helper\Api - REST - PhpBrowser config: REST: depends: PhpBrowser timeout: 90 PhpBrowser: url: '' curl: CURLOPT_TIMEOUT: 90



来源:https://stackoverflow.com/questions/43181920/codeception-rest-timeout-issue

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!