From 267c7d994e15422a122915280342a4a3cc2f7834 Mon Sep 17 00:00:00 2001 From: Anatoli Babenia Date: Wed, 4 Nov 2020 12:51:01 +0300 Subject: [PATCH 1/4] .travis.yml Use `curl` with connection timeout This should fix current build failure with timeout https://travis-ci.org/github/chubin/cheat.sh/builds/741308362#L402 --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index f64a78e..21b10e2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,8 +10,7 @@ before_install: - docker-compose ps script: - - sleep 3 - - curl http://localhost:8002 + - curl --connect-timeout 10 http://localhost:8002 - docker-compose logs --no-color - docker logs chtsh - CHEATSH_TEST_STANDALONE=NO bash tests/run-tests.sh From 8949a8eac82a75c406f82dd47ea74a59ec659e61 Mon Sep 17 00:00:00 2001 From: Anatoli Babenia Date: Wed, 4 Nov 2020 15:14:11 +0300 Subject: [PATCH 2/4] Use `curl` retry flags for waiting for service `--connect-timeout` didn't work, because Docker allows it, but breaks, because nothing is listening on the other side, giving this error. $ curl --connect-timeout 10 http://localhost:8002 curl: (56) Recv failure: Connection reset by peer The command "curl --connect-timeout 10 http://localhost:8002" exited with 56. https://travis-ci.org/github/chubin/cheat.sh/builds/741348053#L401 `--retry-all` makes `curl` retry on all errors, including connection resets. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 21b10e2..88a8805 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ before_install: - docker-compose ps script: - - curl --connect-timeout 10 http://localhost:8002 + - curl --retry 3 --retry-all http://localhost:8002 - docker-compose logs --no-color - docker logs chtsh - CHEATSH_TEST_STANDALONE=NO bash tests/run-tests.sh From 06a91fd953aa24cb12c330b05e0a8645019b648b Mon Sep 17 00:00:00 2001 From: Anatoli Babenia Date: Wed, 4 Nov 2020 16:12:59 +0300 Subject: [PATCH 3/4] Try newer Ubuntu with newer `curl` --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 88a8805..bb556c6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -dist: bionic +dist: focal language: - generic @@ -10,7 +10,7 @@ before_install: - docker-compose ps script: - - curl --retry 3 --retry-all http://localhost:8002 + - curl --retry 3 --retry-all-errors http://localhost:8002 - docker-compose logs --no-color - docker logs chtsh - CHEATSH_TEST_STANDALONE=NO bash tests/run-tests.sh From caa16b66b4448d778a12a2d78df0a50e8c722d30 Mon Sep 17 00:00:00 2001 From: Anatoli Babenia Date: Wed, 4 Nov 2020 19:33:11 +0300 Subject: [PATCH 4/4] Use `wget` instead of `curl` to wait for container Because even Ubuntu 20.04 version of `curl` is outdated --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index bb556c6..d3357e4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ before_install: - docker-compose ps script: - - curl --retry 3 --retry-all-errors http://localhost:8002 + - wget --timeout 3 --tries=5 --spider localhost:8002 2>&1 | grep -i http - docker-compose logs --no-color - docker logs chtsh - CHEATSH_TEST_STANDALONE=NO bash tests/run-tests.sh