Skip to content

Instantly share code, notes, and snippets.

@webbj74
Last active August 29, 2015 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save webbj74/3fd89a9f059f17c826d7 to your computer and use it in GitHub Desktop.
Save webbj74/3fd89a9f059f17c826d7 to your computer and use it in GitHub Desktop.
Alter the curl timeout when using behat and goutte
# Problem:
#
# Behat tests fail with messages like:
# [curl] 28: Operation timed out after 30096 milliseconds with 0 bytes received
#
# Reason:
#
# By default, goutte sets CURLOPT_TIMEOUT to 30 seconds
#
# Solution:
#
# You can alter CURLOPT_TIMEOUT universally in your behat tests
# by adding a "guzzle_parameters" subsection to your goutte
# definition
#
# In the example below I set the timeout to 60 seconds
#
default:
paths:
features: tests/features
bootstrap: %behat.paths.features%/bootstrap
extensions:
Behat\MinkExtension\Extension:
goutte:
guzzle_parameters:
curl.options:
CURLOPT_TIMEOUT: 60
selenium2: ~
base_url: http://127.0.0.1:8080/
Drupal\DrupalExtension\Extension:
blackbox: ~
text:
username_field: admin
password_field: admin
drush:
root: docroot
# References:
# - https://github.com/Behat/MinkExtension/blob/master/doc/index.rst
# - http://www.zalexblog.com/2013/12/13/behat-setting-curl-options-with-guzzle-and-goutte/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment