From 9d33e12ec141f97f0b85ec49203f3b2b8baa12ff Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Sun, 19 Jan 2025 18:47:01 +0200 Subject: [PATCH] tests : increase timeout when sanitizers are enabled --- .github/workflows/server.yml | 23 +++++++++++++++++++++-- examples/server/tests/utils.py | 3 +++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/.github/workflows/server.yml b/.github/workflows/server.yml index 671fe595cdfcb6..468fc8c27cd809 100644 --- a/.github/workflows/server.yml +++ b/.github/workflows/server.yml @@ -112,9 +112,9 @@ jobs: -DGGML_OPENMP=OFF ; cmake --build build --config ${{ matrix.build_type }} -j $(nproc) --target llama-server - - name: Build + - name: Build (sanitizers) id: cmake_build - if: ${{ matrix.sanitizer != 'THREAD' }} + if: ${{ matrix.sanitizer != '' && matrix.sanitizer != 'THREAD' }} run: | cmake -B build \ -DGGML_NATIVE=OFF \ @@ -124,12 +124,31 @@ jobs: -DLLAMA_SANITIZE_${{ matrix.sanitizer }}=ON ; cmake --build build --config ${{ matrix.build_type }} -j $(nproc) --target llama-server + - name: Build (sanitizers) + id: cmake_build + if: ${{ matrix.sanitizer == '' }} + run: | + cmake -B build \ + -DGGML_NATIVE=OFF \ + -DLLAMA_BUILD_SERVER=ON \ + -DLLAMA_CURL=ON \ + -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ; + cmake --build build --config ${{ matrix.build_type }} -j $(nproc) --target llama-server + - name: Tests id: server_integration_tests + if: ${{ matrix.sanitizer == '' }} run: | cd examples/server/tests ./tests.sh + - name: Tests (sanitizers) + id: server_integration_tests + if: ${{ matrix.sanitizer != '' }} + run: | + cd examples/server/tests + LLAMA_SANITIZE=1 ./tests.sh + - name: Slow tests id: server_integration_tests_slow if: ${{ (github.event.schedule || github.event.inputs.slow_tests == 'true') && matrix.build_type == 'Release' }} diff --git a/examples/server/tests/utils.py b/examples/server/tests/utils.py index 73be4c92f0f589..b5211953260d96 100644 --- a/examples/server/tests/utils.py +++ b/examples/server/tests/utils.py @@ -89,6 +89,9 @@ def __init__(self): self.server_port = int(os.environ["PORT"]) def start(self, timeout_seconds: int = 10) -> None: + if "LLAMA_SANITIZE" in os.environ: + timeout_seconds = 30 + if "LLAMA_SERVER_BIN_PATH" in os.environ: server_path = os.environ["LLAMA_SERVER_BIN_PATH"] elif os.name == "nt":