Open neelkhatri opened 1 year ago
I had this issue when running source ${BLT_DIR}/scripts/pipelines/tests
on a big, nasty site that takes a lot of time to spin up in the Pipelines CI.
The issue might be occuring for me because I am trying to use the script in a non-standard way; we are calling it during setup-env. I really need the database to sync for the tests, though, and blt drupal:sync:default:site
doesn't seem to want to work during the tests step.
At any rate, the following patch to blt stops the wait and will at least get you past that point so that you can troubleshoot...
diff --git a/vendor/acquia/blt/src/Robo/Common/Executor.php b/vendor/acquia/blt/src/Robo/Common/Executor.php
--- a/vendor/acquia/blt/src/Robo/Common/Executor.php
+++ b/vendor/acquia/blt/src/Robo/Common/Executor.php
@@ -181,7 +181,7 @@ public function killProcessByName($name) {
* The URL to wait for.
*/
public function waitForUrlAvailable($url) {
- $this->wait([$this, 'checkUrl'], [$url], "Waiting for non-50x response from $url...");
+ // $this->wait([$this, 'checkUrl'], [$url], "Waiting for non-50x response from $url...");
}
/**
It's possible, however, that you really do need that wait time, so if your scripts are failing partially at the beginning, instead of removing the wait, you can replace it with a custom sleep() time that works for your application...
diff --git a/vendor/acquia/blt/src/Robo/Common/Executor.php b/vendor/acquia/blt/src/Robo/Common/Executor.php
--- a/vendor/acquia/blt/src/Robo/Common/Executor.php
+++ b/vendor/acquia/blt/src/Robo/Common/Executor.php
@@ -181,7 +181,7 @@ public function killProcessByName($name) {
* The URL to wait for.
*/
public function waitForUrlAvailable($url) {
- $this->wait([$this, 'checkUrl'], [$url], "Waiting for non-50x response from $url...");
+ sleep(60);
}
/**
I did try adding set_time_limit(0);
before the $this->wait(), but that didn't seem to have any effect. I've done extensive searching and can find no mention of how to generally increase the wait time for BLT. It would be nice if this was a setting I could add to blt.yml instead of having to add a wonky patch.
So I guess that's the real question. Is there, during Acquia Pipelines CI, a way to increase the amount of time or attempts that executor waits before crapping out?
We experienced something similar with Travis CI and had to change our ubuntu distro to focal from xenial as recent Chrome versions have had a mismatch for some dependencies.
I've run into this issue intermittently as well, and the above solution to comment out the wait method has fixed the issue for me when necessary. it doesn't "always" happen but when it does, that's how i've worked around it.
FYI this can also sometimes indicate a php fatal error somewhere (and commenting out the wait time can expose that in your CI logs).
can you confirm you have a ci.blt.yml file? see https://github.com/acquia/blt/pull/4489 for getting that added by default (it was missing for a while).
see https://github.com/acquia/blt/issues/4011 for my original issue from a couple of years ago on this broader topic.
Describe the bug After upgrading to BLT 13.7.0 and Drush 11.5.x I am facing issue with my ci pieline. I am seeing "[debug] cURL error 7: Failed to connect to localhost port 9222: Connection refused (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) [info] Waiting for non-50x response from http://localhost:9222/..." error during CI build after behat test triggered.
To Reproduce Steps to reproduce the behavior, ideally starting from a fresh install of BLT:
composer create-project acquia/drupal-recommended-project --no-interaction
Expected behavior It should run ci pieline without any error
Detailed error output
Run All Tests
$COMPOSER_BIN/blt tests:behat --no-interaction --define drush.alias='${drush.aliases.ci}' --define tests.run-server=false --define environment=ci -v [info] Running command /builds/ito-ms/applications/website-factory/drupal/repo/vendor/bin/drush @self status bootstrap BLT can (re)generate tests/behat/local.yml using tests/behat/example.local.yml. [warning] Required file /app/docroot does not exist. [warning] Behat is not configured properly.
with debug mode it is showing some curl 7 error "[debug] cURL error 7: Failed to connect to localhost port 9222: Connection refused (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)"
System information
Additional context Add any other context about the problem here.