Phpunit builds fail, but when i ssh in and run phpunit they work fine

I’ve tried all sorts of setups including phantomJs, selenium standalone server, and now using sauce connect to hit saucelabs. the builds work perfectly fine locally, but always time out / error when running on circle-ci. the WEIRD part is if I ssh in and run phpunit myself, it works perfectly fine. I cannot duplicate this ssh’ed in at all, they always rune fine. i’ve tried all sort of sleeps and timeout extensions to give everything as much time as needed. no luck

here is the setup:

failed build

the actual error

1) Tests\Browser\LoginTest::testClientAdd
Facebook\WebDriver\Exception\WebDriverCurlException: Curl error thrown for http GET to /session/d18207b0747f4149a30ceb8c2fb7c73d/screenshot

Operation timed out after 120000 milliseconds with 0 bytes received


my circle.yml

    version: 7.0.4
    ENVIRONMENT: testing
    APP_ENV: testing
    APP_DEBUG: true

    - pecl install mongodb
    - echo "" > /opt/circleci/php/7.0.4/etc/conf.d/mongodb.ini
    - printf "\n" | pecl install yaml-2.0.0
    - echo "" > /opt/circleci/php/7.0.4/etc/conf.d/yaml.ini
    - composer install --no-interaction
    - npm i --prefix vendor/acidjazz/larpug/node/
    - wget
    - tar -xzf sc-4.4.4-linux.tar.gz

    - php ./artisan serve:
        background: true
    - cd sc-4.4.4-linux && ./bin/sc --user $SAUCE_USERNAME --api-key $SAUCE_ACCESS_KEY --readyfile ~/sauce_is_ready:
        background: true
    # Wait for tunnel to be ready
    - while [ ! -e ~/sauce_is_ready ]; do sleep 1; done
    - ./vendor/bin/phpunit
Curl error thrown for http GET to /session/d18207b0747f4149a30ceb8c2fb7c73d/screenshot

Are you logging these errors somewhere? If so, can you save them as an artifact and paste the output here? It would be helpful to see the full error that CURL is getting.

I’ve looked into some kind of logging flag to pass to curl from WebDriver, no look so far. Any idea why this works via SSH though?

There might be a race condition, or the tests are running “too fast”

Operation timed out after 120000 milliseconds with 0 bytes received

Is there a way to increase the timeout perhaps?

I tried increasing the timeouts in the webdriver and adding sleeps around each server start up to about 20 seconds each, no matter what I still timedout, immediately ssh’ed in, ran phpunit, and it was fine.

Did you manage to find a fix for this? I am receiving the exact same error, however it happens intermittently. I will run the build the first time and it will fail with the above error, I will then rebuild and it will work fine. This happens often enough to be annoying. SSH’ing in and running the builds will intermittently fail also.