From e4ad2580e12c39a96c19e796de001f1a3bb82df7 Mon Sep 17 00:00:00 2001 From: kezhenxu94 Date: Wed, 14 Sep 2022 07:13:31 +0800 Subject: [PATCH] test: fix unstable log cases (#9601) --- test/e2e-v2/cases/kafka/log/e2e.yaml | 7 ++----- test/e2e-v2/cases/log/es/e2e.yaml | 7 ++----- test/e2e-v2/cases/log/es/es-sharding/e2e.yaml | 7 ++----- test/e2e-v2/cases/log/expected/logs.yml | 4 ++-- test/e2e-v2/cases/log/expected/service-endpoint.yml | 6 +++--- test/e2e-v2/cases/log/fluent-bit/e2e.yaml | 7 ++----- test/e2e-v2/cases/log/h2/e2e.yaml | 7 ++----- test/e2e-v2/cases/log/log-cases-base.yaml | 4 ++-- test/e2e-v2/cases/log/mysql/e2e.yaml | 7 ++----- test/e2e-v2/cases/log/postgres/e2e.yaml | 7 ++----- 10 files changed, 21 insertions(+), 42 deletions(-) diff --git a/test/e2e-v2/cases/kafka/log/e2e.yaml b/test/e2e-v2/cases/kafka/log/e2e.yaml index ec3ae06b61..18fa9b0212 100644 --- a/test/e2e-v2/cases/kafka/log/e2e.yaml +++ b/test/e2e-v2/cases/kafka/log/e2e.yaml @@ -32,11 +32,8 @@ trigger: action: http interval: 3s times: 10 - url: http://${provider_host}:${provider_9090}/users - method: POST - body: '{"id":"123","name":"skywalking"}' - headers: - "Content-Type": "application/json" + url: http://${provider_host}:${provider_9090}/logs/trigger + method: GET verify: retry: diff --git a/test/e2e-v2/cases/log/es/e2e.yaml b/test/e2e-v2/cases/log/es/e2e.yaml index e474fbb671..ca75d051fd 100644 --- a/test/e2e-v2/cases/log/es/e2e.yaml +++ b/test/e2e-v2/cases/log/es/e2e.yaml @@ -32,11 +32,8 @@ trigger: action: http interval: 3s times: 10 - url: http://${provider_host}:${provider_9090}/users - method: POST - body: '{"id":"123","name":"skywalking"}' - headers: - "Content-Type": "application/json" + url: http://${provider_host}:${provider_9090}/logs/trigger + method: GET verify: # verify with retry strategy diff --git a/test/e2e-v2/cases/log/es/es-sharding/e2e.yaml b/test/e2e-v2/cases/log/es/es-sharding/e2e.yaml index c711ad9333..592267acd0 100644 --- a/test/e2e-v2/cases/log/es/es-sharding/e2e.yaml +++ b/test/e2e-v2/cases/log/es/es-sharding/e2e.yaml @@ -32,11 +32,8 @@ trigger: action: http interval: 3s times: 10 - url: http://${provider_host}:${provider_9090}/users - method: POST - body: '{"id":"123","name":"skywalking"}' - headers: - "Content-Type": "application/json" + url: http://${provider_host}:${provider_9090}/logs/trigger + method: GET verify: # verify with retry strategy diff --git a/test/e2e-v2/cases/log/expected/logs.yml b/test/e2e-v2/cases/log/expected/logs.yml index 43897b6a68..2634819b7c 100644 --- a/test/e2e-v2/cases/log/expected/logs.yml +++ b/test/e2e-v2/cases/log/expected/logs.yml @@ -20,8 +20,8 @@ logs: serviceid: {{ b64enc "e2e-service-provider" }}.1 serviceinstancename: provider1 serviceinstanceid: {{ b64enc "e2e-service-provider" }}.1_{{ b64enc "provider1" }} - endpointname: POST:/users - endpointid: {{ b64enc "e2e-service-provider" }}.1_{{ b64enc "POST:/users" }} + endpointname: GET:/logs/trigger + endpointid: {{ b64enc "e2e-service-provider" }}.1_{{ b64enc "GET:/logs/trigger" }} traceid: {{ .traceid }} timestamp: {{ gt .timestamp 0 }} contenttype: TEXT diff --git a/test/e2e-v2/cases/log/expected/service-endpoint.yml b/test/e2e-v2/cases/log/expected/service-endpoint.yml index dd58100f94..4efc7bb8ad 100644 --- a/test/e2e-v2/cases/log/expected/service-endpoint.yml +++ b/test/e2e-v2/cases/log/expected/service-endpoint.yml @@ -14,6 +14,6 @@ # limitations under the License. {{- contains .}} -- id: {{ b64enc "e2e-service-provider" }}.1_{{ b64enc "POST:/users" }} - name: POST:/users -{{- end}} \ No newline at end of file +- id: {{ b64enc "e2e-service-provider" }}.1_{{ b64enc "GET:/logs/trigger" }} + name: GET:/logs/trigger +{{- end}} diff --git a/test/e2e-v2/cases/log/fluent-bit/e2e.yaml b/test/e2e-v2/cases/log/fluent-bit/e2e.yaml index e474fbb671..ca75d051fd 100644 --- a/test/e2e-v2/cases/log/fluent-bit/e2e.yaml +++ b/test/e2e-v2/cases/log/fluent-bit/e2e.yaml @@ -32,11 +32,8 @@ trigger: action: http interval: 3s times: 10 - url: http://${provider_host}:${provider_9090}/users - method: POST - body: '{"id":"123","name":"skywalking"}' - headers: - "Content-Type": "application/json" + url: http://${provider_host}:${provider_9090}/logs/trigger + method: GET verify: # verify with retry strategy diff --git a/test/e2e-v2/cases/log/h2/e2e.yaml b/test/e2e-v2/cases/log/h2/e2e.yaml index e474fbb671..ca75d051fd 100644 --- a/test/e2e-v2/cases/log/h2/e2e.yaml +++ b/test/e2e-v2/cases/log/h2/e2e.yaml @@ -32,11 +32,8 @@ trigger: action: http interval: 3s times: 10 - url: http://${provider_host}:${provider_9090}/users - method: POST - body: '{"id":"123","name":"skywalking"}' - headers: - "Content-Type": "application/json" + url: http://${provider_host}:${provider_9090}/logs/trigger + method: GET verify: # verify with retry strategy diff --git a/test/e2e-v2/cases/log/log-cases-base.yaml b/test/e2e-v2/cases/log/log-cases-base.yaml index ed79bec2be..49a43415a0 100644 --- a/test/e2e-v2/cases/log/log-cases-base.yaml +++ b/test/e2e-v2/cases/log/log-cases-base.yaml @@ -18,7 +18,7 @@ - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service layer GENERAL expected: expected/service.yml # service endpoint - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql endpoint list --keyword=users --service-name=e2e-service-provider + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql endpoint list --keyword=logs --service-name=e2e-service-provider expected: expected/service-endpoint.yml # service instance list - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-provider @@ -27,6 +27,6 @@ - query: | swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql logs list --service-name=e2e-service-provider --tags level=INFO --trace-id=$( \ swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls \ - | yq e '.traces | select(.[].endpointnames[0]=="POST:/users") | .[0].traceids[0]' - + | yq e '.traces | select(.[].endpointnames[0]=="GET:/logs/trigger") | sort_by(.start) | reverse | .[0].traceids[0]' - ) expected: expected/logs.yml diff --git a/test/e2e-v2/cases/log/mysql/e2e.yaml b/test/e2e-v2/cases/log/mysql/e2e.yaml index e474fbb671..ca75d051fd 100644 --- a/test/e2e-v2/cases/log/mysql/e2e.yaml +++ b/test/e2e-v2/cases/log/mysql/e2e.yaml @@ -32,11 +32,8 @@ trigger: action: http interval: 3s times: 10 - url: http://${provider_host}:${provider_9090}/users - method: POST - body: '{"id":"123","name":"skywalking"}' - headers: - "Content-Type": "application/json" + url: http://${provider_host}:${provider_9090}/logs/trigger + method: GET verify: # verify with retry strategy diff --git a/test/e2e-v2/cases/log/postgres/e2e.yaml b/test/e2e-v2/cases/log/postgres/e2e.yaml index e474fbb671..ca75d051fd 100644 --- a/test/e2e-v2/cases/log/postgres/e2e.yaml +++ b/test/e2e-v2/cases/log/postgres/e2e.yaml @@ -32,11 +32,8 @@ trigger: action: http interval: 3s times: 10 - url: http://${provider_host}:${provider_9090}/users - method: POST - body: '{"id":"123","name":"skywalking"}' - headers: - "Content-Type": "application/json" + url: http://${provider_host}:${provider_9090}/logs/trigger + method: GET verify: # verify with retry strategy