curlcodeception

Codeception REST timeout issue


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?


Solution

  • 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 :)