From c9ff993aeb9528eb9ea15cefe50df692e6dc7e7f Mon Sep 17 00:00:00 2001 From: Mikhail Koviazin Date: Mon, 2 Sep 2024 15:28:46 +0200 Subject: [PATCH] github: replace call for sleep with wait-for-it.sh Previously integration tests invoked `sleep 10` to "give time to settle" the environment. In a fast container, waiting for so long is not needed and in a slow one it might not be enough. This commit changes this line to use `./util/wait-for-it.sh` instead [1] to check robustly that the port is being listened to. Fixes #49. [1] https://github.com/vishnubob/wait-for-it Signed-off-by: Mikhail Koviazin --- .github/workflows/integration.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index f218e4a9..df15684b 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -79,7 +79,11 @@ jobs: pip install "libvalkey>=4.0.0" fi invoke devenv - sleep 10 # time to settle + if [[ "${{matrix.test-type}}" == "standalone" ]]; then + ./util/wait-for-it.sh localhost:6379 + else + ./util/wait-for-it.sh localhost:16379 + fi invoke ${{matrix.test-type}}-tests --protocol=${{ matrix.protocol-version }} if [[ "${{matrix.python-version}}" != pypy-* ]]; then invoke ${{matrix.test-type}}-tests --uvloop --protocol=${{ matrix.protocol-version }}