Skip to content

Stabilize e2e dual-stack test#936

Merged
istio-testing merged 1 commit intoistio-ecosystem:mainfrom
unsortedhashsets:istio-main
Jun 20, 2025
Merged

Stabilize e2e dual-stack test#936
istio-testing merged 1 commit intoistio-ecosystem:mainfrom
unsortedhashsets:istio-main

Conversation

@unsortedhashsets
Copy link
Copy Markdown
Contributor

What type of PR is this?

  • Enhancement / New Feature
  • Bug Fix
  • Refactor
  • Optimization
  • Test
  • Documentation Update

What this PR does / why we need it:

Allows wait inside CheckPodsReady func till pods will be ready (avoid errors during dual-stack tests like

[38;5;9m[FAILED] No pods found in dual-stack namespace
  Expected
      <[]v1.Pod | len:0, cap:0>: nil
  not to be empty�[0m

Same principle as used here: https://github.com/istio-ecosystem/sail-operator/blob/main/tests/e2e/controlplane/control_plane_test.go#L221

Which issue(s) this PR fixes:

Fixes #

Related Issue/PR #

Additional information:

@unsortedhashsets unsortedhashsets requested a review from a team as a code owner June 19, 2025 11:50
@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla bot commented Jun 19, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: unsortedhashsets / name: Mikhail Abramov (26f572e)

@istio-testing
Copy link
Copy Markdown
Collaborator

Hi @unsortedhashsets. Thanks for your PR.

I'm waiting for a istio-ecosystem or istio member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@sridhargaddam
Copy link
Copy Markdown
Contributor

/ok-to-test

@sridhargaddam
Copy link
Copy Markdown
Contributor

@unsortedhashsets did you see the error with Kind setup or OCP deployments?

@unsortedhashsets
Copy link
Copy Markdown
Contributor Author

unsortedhashsets commented Jun 19, 2025

@unsortedhashsets did you see the error with Kind setup or OCP deployments?

With OCP, in general problem was in too fast check of pods existing

@@ -294,16 +294,15 @@ func GetVersionFromIstiod() (*semver.Version, error) {
func CheckPodsReady(ctx SpecContext, cl client.Client, namespace string) (*corev1.PodList, error) {
Copy link
Copy Markdown
Contributor

@fjglira fjglira Jun 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if we remove all the eventually inside the function and we call the eventually from outside, I mean. Something like this:

  • Currently, we are using the function:
_, err = common.CheckPodsReady(ctx, cl, DualStackNamespace)
						Expect(err).ToNot(HaveOccurred(), fmt.Sprintf("Error checking status of dual-stack pods: %v", err))
  • Change the use for this:
Eventually(common.CheckPodsReady).WithArguments(ctx, cl, DualStackNamespace).Should(Succeed(), "Error checking status of dual-stack pods")

With this, we will use only one eventually, and we will simplify the code in the test. The only downside of this is that the function CheckPodsReady currently returns *corev1.PodList and error, and my suggestion will not work with those returns. But in my opinion, the function should only check that the pods in the namespace are ready, and after we check that the pods are ready and not return a list of pods, we can get the pods of the namespace in a following step to be used in later validations. Wdyt @sridhargaddam ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, in that case, I suggest avoiding using a function with the name CheckPodsReady to return a list of pods. So, we can check the pods are ready in the ns with a function that only checks the state of the pods, and then we can get the list of the pods from the ns to use it later in the next steps. We already get only the pods like that using the client:
For example:

					samplePodsCluster2 := &corev1.PodList{}
					It("updates the pods status to Ready", func(ctx SpecContext) {
						Expect(clRemote.List(ctx, samplePodsCluster2, client.InNamespace(sampleNamespace))).To(Succeed())
						Expect(samplePodsCluster2.Items).ToNot(BeEmpty(), "No pods found in sample namespace")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@unsortedhashsets I mean this is not something strictly related to your PR, I'm just seeing that this can be improved also at the same time with your PR. Using two eventually inside the same function seems a little redundant for me, we can simplified easily moving our the eventually

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for clarification, will try that approach

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have just replaced function call with two internal Eventually with more go one and external Eventually.
On dualstack works fine, also found few places to use in controle plane tests, lets see the test run.

@unsortedhashsets unsortedhashsets force-pushed the istio-main branch 2 times, most recently from f9f4a86 to 7fd60b7 Compare June 19, 2025 15:39
@unsortedhashsets unsortedhashsets requested a review from fjglira June 19, 2025 16:05
Copy link
Copy Markdown
Contributor

@fjglira fjglira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, only a smal small comment


samplePods := &corev1.PodList{}
Eventually(common.CheckPodsReady).WithArguments(ctx, cl, sampleNamespace).Should(Succeed(), "Error checking status of sample pods")
Expect(cl.List(ctx, samplePods, client.InNamespace(sampleNamespace))).To(Succeed(), "Error deploying sample pod")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggested that you change the error message from Error deploying sample pod to Error getting the pods in sample namespace. Note: in all the places that you are using the same message :)

Copy link
Copy Markdown
Contributor Author

@unsortedhashsets unsortedhashsets Jun 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, agree, it's describing operation better

Signed-off-by: Mikhail Abramov <mabramov@redhat.com>
Copy link
Copy Markdown
Contributor

@fjglira fjglira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@istio-testing istio-testing merged commit b22ae1e into istio-ecosystem:main Jun 20, 2025
12 checks passed
@mkralik3
Copy link
Copy Markdown
Contributor

@unsortedhashsets please, if possible, backport to release-1.26 as well as release-1.0

openshift-service-mesh-bot pushed a commit to openshift-service-mesh-bot/sail-operator that referenced this pull request Jun 20, 2025
* upstream/main:
  Stabilize e2e dual-stack test (istio-ecosystem#936)
unsortedhashsets added a commit to unsortedhashsets/sail-operator that referenced this pull request Jun 23, 2025
Signed-off-by: Mikhail Abramov <mabramov@redhat.com>
unsortedhashsets added a commit to unsortedhashsets/sail-operator that referenced this pull request Jun 23, 2025
Signed-off-by: Mikhail Abramov <mabramov@redhat.com>
istio-testing pushed a commit that referenced this pull request Jun 23, 2025
Signed-off-by: Mikhail Abramov <mabramov@redhat.com>
openshift-merge-bot bot pushed a commit to openshift-service-mesh/sail-operator that referenced this pull request Jun 27, 2025
* Stabilize e2e dual-stack test (istio-ecosystem#936) (istio-ecosystem#939)

Signed-off-by: Mikhail Abramov <mabramov@redhat.com>

* fix IstioRevisionTag uninstall when revision namespace changes (istio-ecosystem#945)

Fixes istio-ecosystem#917.

This is quite a complex edge case, I'll do my best to explain. If you
look at the integration test I wrote (part of this commit), you can
follow along.

When a tag was created that referenced a revision in ns1, then patched
to reference a revision in ns2, we failed to clean up the old helm
install in ns1. That almost never causes problems - except in the case
where afterwards, you remove all tags, and then create a new one with
the same name that is never reconciled. If that tag is deleted, the operator will
attempt to uninstall that lingering helm release, which fails, leading
the operator to deadlock, and stopping the user from deleting the tag.
The only way to get the operator back into a working state would be to
manually delete that lingering helm release. That is a pretty
significant bug in my opinion.

Signed-off-by: Daniel Grimm <dgrimm@redhat.com>
Co-authored-by: Daniel Grimm <dgrimm@redhat.com>

* Expose "Profile" parameter in UI for Istio and IstioCNI (istio-ecosystem#924) (istio-ecosystem#947)

During deployment of Istio in ambient mode, the user should be able to
set the "profile: ambient" for Istio and IstioCNI resources.
Currently, this parameter is hidden from the UI.
Turn on the visibility of this parameter in the UI.

Signed-off-by: Maxim Babushkin <mbabushk@redhat.com>

* [Manual Cherry pick] Pick e2e improve and solving helm issues (istio-ecosystem#948)

* Consolidate multicluster operator deploy/cleanup (istio-ecosystem#902)

Now that we have `Cleaner` clean up after each test, it makes sense to
run this logic once in the suite, rather than after each test (which
cleans up its own resources).

Signed-off-by: Mike Kolesnik <mkolesni@redhat.com>

* Fix typo in the ReportAfterSuite text (istio-ecosystem#911)

Signed-off-by: Sridhar Gaddam <sgaddam@redhat.com>

* Fix helm issue during e2e test run  operator installation (istio-ecosystem#914)

* Fix helm issue during e2e test run  operator installation

Signed-off-by: Francisco H <frherrer@redhat.com>

Fix command error

Signed-off-by: Francisco H <frherrer@redhat.com>

* Apply suggestions from code review

Co-authored-by: Mike Kolesnik <mkolesni@redhat.com>
Signed-off-by: Francisco H <frherrer@redhat.com>

* Improves from code review

Signed-off-by: Francisco H <frherrer@redhat.com>

* Update comment in build and push script

Signed-off-by: Francisco H <frherrer@redhat.com>

---------

Signed-off-by: Francisco H <frherrer@redhat.com>
Co-authored-by: Mike Kolesnik <mkolesni@redhat.com>

* Consolidate e2e resource creation (istio-ecosystem#931)

* Consolidate IstioCNI creation in e2e tests

This code is very repetitive and would better live in a common function.

Signed-off-by: Mike Kolesnik <mkolesni@redhat.com>

* Consolidate Istio creation in e2e tests

This code is very repetitive and would better live in a common function.

Signed-off-by: Mike Kolesnik <mkolesni@redhat.com>

---------

Signed-off-by: Mike Kolesnik <mkolesni@redhat.com>

* Use `Eventually` in remote secret generation (istio-ecosystem#921)

In this test the secret generation sometimes is attempted before
everything is ready, leading to flaky, hard to debug, failures.

Using `Eventually` to generate the secret avoids these failures.

Fixes: istio-ecosystem#866

Signed-off-by: Mike Kolesnik <mkolesni@redhat.com>

---------

Signed-off-by: Mike Kolesnik <mkolesni@redhat.com>
Signed-off-by: Sridhar Gaddam <sgaddam@redhat.com>
Signed-off-by: Francisco H <frherrer@redhat.com>
Co-authored-by: Mike Kolesnik <mkolesni@redhat.com>
Co-authored-by: Sridhar Gaddam <sgaddam@redhat.com>

* Bump to 1.26.2, add Istio 1.26.2 (istio-ecosystem#950)

Signed-off-by: Daniel Grimm <dgrimm@redhat.com>

---------

Signed-off-by: Mikhail Abramov <mabramov@redhat.com>
Signed-off-by: Daniel Grimm <dgrimm@redhat.com>
Signed-off-by: Maxim Babushkin <mbabushk@redhat.com>
Signed-off-by: Mike Kolesnik <mkolesni@redhat.com>
Signed-off-by: Sridhar Gaddam <sgaddam@redhat.com>
Signed-off-by: Francisco H <frherrer@redhat.com>
Co-authored-by: Mikhail Abramov <mabramov@redhat.com>
Co-authored-by: Istio Automation <istio-testing-bot@google.com>
Co-authored-by: Daniel Grimm <dgrimm@redhat.com>
Co-authored-by: Maxim Babushkin <mbabushk@redhat.com>
Co-authored-by: Francisco Herrera <frherrer@redhat.com>
Co-authored-by: Mike Kolesnik <mkolesni@redhat.com>
Co-authored-by: Sridhar Gaddam <sgaddam@redhat.com>
dgn pushed a commit to dgn/sail-operator that referenced this pull request Mar 17, 2026
Signed-off-by: Mikhail Abramov <mabramov@redhat.com>
Signed-off-by: Daniel Grimm <dgrimm@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants