From f6ac1bec55cfd71b4e854a12b61665dc9ad67cf3 Mon Sep 17 00:00:00 2001 From: Ron Federman <73110295+RonFed@users.noreply.github.com> Date: Mon, 25 Nov 2024 09:27:33 +0200 Subject: [PATCH] Fix flaky cli-upgrade test (#1843) Adding an assertion for a ready `data-collection` pod with the upgraded image. --------- Co-authored-by: Tamir David --- .../assert-instrumented-and-pipeline.yaml | 2 ++ .../cli-upgrade/assert-odigos-upgraded.yaml | 29 +++++++++++++++++++ tests/e2e/cli-upgrade/chainsaw-test.yaml | 7 +++-- 3 files changed, 35 insertions(+), 3 deletions(-) diff --git a/tests/e2e/cli-upgrade/assert-instrumented-and-pipeline.yaml b/tests/e2e/cli-upgrade/assert-instrumented-and-pipeline.yaml index e83ab4ced..41a81fac8 100644 --- a/tests/e2e/cli-upgrade/assert-instrumented-and-pipeline.yaml +++ b/tests/e2e/cli-upgrade/assert-instrumented-and-pipeline.yaml @@ -315,6 +315,7 @@ status: (value != null): true - key: k8s.pod.name (value != null): true +--- apiVersion: odigos.io/v1alpha1 kind: InstrumentationInstance metadata: @@ -336,6 +337,7 @@ status: (value != null): true - key: k8s.pod.name (value != null): true +--- apiVersion: odigos.io/v1alpha1 kind: InstrumentationInstance metadata: diff --git a/tests/e2e/cli-upgrade/assert-odigos-upgraded.yaml b/tests/e2e/cli-upgrade/assert-odigos-upgraded.yaml index a69cac6ac..c26a2699e 100644 --- a/tests/e2e/cli-upgrade/assert-odigos-upgraded.yaml +++ b/tests/e2e/cli-upgrade/assert-odigos-upgraded.yaml @@ -96,6 +96,35 @@ status: --- apiVersion: v1 kind: Pod +metadata: + labels: + odigos.io/collector-role: NODE_COLLECTOR + namespace: odigos-test-cli-upgrade + ownerReferences: + - apiVersion: apps/v1 + blockOwnerDeletion: true + controller: true + kind: DaemonSet + name: odigos-data-collection +spec: + containers: + - name: data-collection + image: keyval/odigos-collector:e2e-test + hostNetwork: true + nodeSelector: + kubernetes.io/os: linux + serviceAccount: odigos-data-collection + serviceAccountName: odigos-data-collection +status: + containerStatuses: + - name: data-collection + ready: true + restartCount: 0 + started: true + phase: Running +--- +apiVersion: v1 +kind: Pod metadata: labels: odigos.io/collector-role: CLUSTER_GATEWAY diff --git a/tests/e2e/cli-upgrade/chainsaw-test.yaml b/tests/e2e/cli-upgrade/chainsaw-test.yaml index 9fbe096ba..b899a8e43 100644 --- a/tests/e2e/cli-upgrade/chainsaw-test.yaml +++ b/tests/e2e/cli-upgrade/chainsaw-test.yaml @@ -109,14 +109,15 @@ spec: timeout: 60s - assert: file: assert-odigos-upgraded.yaml + - name: Instrumented and pipeline ready after upgrade + try: + - assert: + file: assert-instrumented-and-pipeline.yaml - name: Generate Traffic try: - script: timeout: 300s content: | - # Make sure that odigos components are ready - sleep 20 - # Apply the job kubectl apply -f 05-generate-traffic.yaml