diff --git a/docs/en/changes/changes.md b/docs/en/changes/changes.md index c0edd2f7c1..bff21f1285 100644 --- a/docs/en/changes/changes.md +++ b/docs/en/changes/changes.md @@ -29,6 +29,7 @@ * [Break Change]Storage: Move `event` from metrics to records. * Remove string limitation in Jackson deserializer for ElasticSearch client. * Fix `disable.oal` does not work. +* Enhance the stability of e2e PHP tests and update the PHP agent version. #### UI diff --git a/test/e2e-v2/cases/php/Dockerfile.php b/test/e2e-v2/cases/php/Dockerfile.php index f3fe4c8f64..a74bc18be6 100644 --- a/test/e2e-v2/cases/php/Dockerfile.php +++ b/test/e2e-v2/cases/php/Dockerfile.php @@ -20,12 +20,12 @@ ARG SW_AGENT_PHP_COMMIT ENV RUSTUP_HOME=/usr/local/rustup \ CARGO_HOME=/usr/local/cargo \ PATH=/usr/local/cargo/bin:$PATH \ - RUST_VERSION=1.64.0 + RUST_VERSION=1.85.1 WORKDIR /tmp RUN apt update \ && apt install -y wget protobuf-compiler libclang-dev git \ - && wget https://static.rust-lang.org/rustup/archive/1.25.1/x86_64-unknown-linux-gnu/rustup-init \ + && wget https://static.rust-lang.org/rustup/archive/1.28.2/x86_64-unknown-linux-gnu/rustup-init \ && chmod +x rustup-init \ && ./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host x86_64-unknown-linux-gnu \ && rm rustup-init \ diff --git a/test/e2e-v2/cases/php/docker-compose.yml b/test/e2e-v2/cases/php/docker-compose.yml index 452bdeed9e..734a4fb24f 100644 --- a/test/e2e-v2/cases/php/docker-compose.yml +++ b/test/e2e-v2/cases/php/docker-compose.yml @@ -22,6 +22,8 @@ services: service: oap ports: - 12800 + networks: + - e2e banyandb: extends: @@ -29,6 +31,8 @@ services: service: banyandb ports: - 17912 + networks: + - e2e php: build: @@ -42,13 +46,20 @@ services: - 8080 depends_on: provider: - condition: service_started + condition: service_healthy oap: condition: service_healthy + banyandb: + condition: service_healthy volumes: - ./index.php:/var/www/html/index.php - ./php.ini:/usr/local/etc/php/conf.d/ext-skywalking_agent.ini - ./nginx.conf:/etc/nginx/nginx.conf + healthcheck: + test: ["CMD", "sh", "-c", "nc -z 127.0.0.1 8080"] + interval: 5s + timeout: 60s + retries: 120 provider: extends: @@ -57,6 +68,8 @@ services: depends_on: oap: condition: service_healthy + networks: + - e2e networks: e2e: diff --git a/test/e2e-v2/cases/php/e2e.yaml b/test/e2e-v2/cases/php/e2e.yaml index 7d6fd77839..acfc47bbc2 100644 --- a/test/e2e-v2/cases/php/e2e.yaml +++ b/test/e2e-v2/cases/php/e2e.yaml @@ -38,7 +38,7 @@ trigger: verify: # verify with retry strategy retry: - count: 30 + count: 10 interval: 15s cases: # layer list @@ -66,7 +66,7 @@ verify: - query: | swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace $( \ swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls --service-name=php\ - | yq e '.traces | select(.[].endpointnames[0]=="POST:/php/info") | .[9].traceids[0]' - + | yq e '.traces | select(.[].endpointnames[0]=="POST:/php/info") | .[2].traceids[0]' - ) expected: expected/trace-info-detail.yml # dependency service diff --git a/test/e2e-v2/cases/php/index.php b/test/e2e-v2/cases/php/index.php index 764c01fc92..5c32d4ed40 100644 --- a/test/e2e-v2/cases/php/index.php +++ b/test/e2e-v2/cases/php/index.php @@ -22,5 +22,10 @@ if($uri == '/php/info') { curl_setopt($ch, CURLOPT_URL, "http://provider:9090/info"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $output = curl_exec($ch); + if (curl_errno($ch)) { + $error_code = curl_errno($ch); + $error_message = curl_error($ch); + throw new Exception("curl failed: $error_code $error_message"); + } curl_close($ch); } diff --git a/test/e2e-v2/cases/php/php.ini b/test/e2e-v2/cases/php/php.ini index 8789034b0e..ab60122011 100644 --- a/test/e2e-v2/cases/php/php.ini +++ b/test/e2e-v2/cases/php/php.ini @@ -18,7 +18,7 @@ extension = skywalking_agent.so skywalking_agent.service_name = php skywalking_agent.enable = 1 -skywalking_agent.log_file = /tmp/skywalking-agent.log +skywalking_agent.log_file = /proc/1/fd/2 skywalking_agent.log_level = DEBUG skywalking_agent.server_addr = oap:11800 diff --git a/test/e2e-v2/script/env b/test/e2e-v2/script/env index 09ad865c6c..2b0863ba8e 100644 --- a/test/e2e-v2/script/env +++ b/test/e2e-v2/script/env @@ -24,7 +24,7 @@ SW_AGENT_CLIENT_JS_TEST_COMMIT=4f1eb1dcdbde3ec4a38534bf01dded4ab5d2f016 SW_KUBERNETES_COMMIT_SHA=6fe5e6f0d3b7686c6be0457733e825ee68cb9b35 SW_ROVER_COMMIT=79292fe07f17f98f486e0c4471213e1961fb2d1d SW_BANYANDB_COMMIT=c4b4384f3083f44ca6067257f5fa59030427ad6b -SW_AGENT_PHP_COMMIT=3192c553002707d344bd6774cfab5bc61f67a1d3 +SW_AGENT_PHP_COMMIT=d1114e7be5d89881eec76e5b56e69ff844691e35 SW_PREDICTOR_COMMIT=54a0197654a3781a6f73ce35146c712af297c994 SW_CTL_COMMIT=7bbac156e74e8fdc0c5bd6f377be9f0b30420176