Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrap K8s client in E2E with retry logic #3366

Merged
merged 29 commits into from
Feb 7, 2024

Conversation

mociarain
Copy link
Collaborator

@mociarain mociarain commented Jan 23, 2024

Which issue this PR addresses:

Fixes https://issues.redhat.com/browse/ARO-4489#L67 and

What this PR does / why we need it:

This PR addresses the first part of initiative 1 outlined here.

TODO:

  • (Assuming the approach is okay'd) Apply expand this PR to fully cover the k8s API calls.
  • (Assuming the approach is okay'd) Start another PR/PR's for the other clients. Not doing. See here for details.
  • Bump ginkgo to 2.8.x (We're on 2.7.0) at least to get the GinkoHelper and apply that to the helper methods. Ideally, I would do this here as part of this PR. Is bumping the version of a dependency a big deal? AFAIK it's used (nearly) entirely in the E2E tests so I'm hoping it will be smooth. Will do in a subsequent PR. This one is meaty enough.

Test plan for issue:

Run them all.

Is there any documentation that needs to be updated for this PR?

Very possibly

Comment on lines 16 to 27
var (
DefaultTimeout = 5 * time.Second
PollingInterval = 250 * time.Millisecond
)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Unclear to me at this point what these numbers should be and if we should expose them in the API for users to mess with

Copy link
Contributor

@kimorris27 kimorris27 left a comment

Choose a reason for hiding this comment

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

I like this approach!

Re: your concern about where/when to bump the dependency, I don't see any problem with doing it in the same PR as this work. I think that's typically what we do unless it's an especially scary/large set of dependency bumps.

tsatam
tsatam previously approved these changes Jan 24, 2024
Copy link
Collaborator

@tsatam tsatam left a comment

Choose a reason for hiding this comment

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

I'm a big fan of this approach and implementation, I love the usage of generics here.

I'm in favor of having this PR, if acceptable to the wider team, merge as-is, and to make the effort of rolling this out across all our E2E tests the work of future stories, that are spread across the team. It'd be slower, but it would get more people involved in the change to hopefully normalize this approach across future tests as well.

test/e2e/helpers.go Outdated Show resolved Hide resolved
@mociarain
Copy link
Collaborator Author

mociarain commented Jan 25, 2024

I'm in favour of having this PR, if acceptable to the wider team, merge as-is, and to make the effort of rolling this out across all our E2E tests the work of future stories, that are spread across the team. It'd be slower, but it would get more people involved in the change to hopefully normalize this approach across future tests as well.

I like this approach but I would suggest that splitting the work by client would be a more natural division. I can expand this PR to cover the k8s client and version bump and then people could pick up each of the other clients?

What do you think?

(I actually have a second proposal that builds on this concept that I thought would be useful to spread around for the same reasons you outline but I think you're right and we can start introducing it from here)

@tsatam
Copy link
Collaborator

tsatam commented Jan 25, 2024

I think that works too, my goal is to split work on this across the team, whichever way we split it is fine by me as long as it gets enough eyes on the change.

tsatam
tsatam previously approved these changes Jan 30, 2024
Copy link
Collaborator

@tsatam tsatam left a comment

Choose a reason for hiding this comment

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

👍🏼

kimorris27
kimorris27 previously approved these changes Jan 30, 2024
@mociarain mociarain dismissed stale reviews from kimorris27 and tsatam via dc03987 January 31, 2024 11:44
@@ -1,90 +0,0 @@
package project
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This was only being used by cluster.go so I just co-located it.

@github-actions github-actions bot added the needs-rebase branch needs a rebase label Jan 31, 2024
Copy link

Please rebase pull request.

@mociarain mociarain changed the title Refactor e2e expect not to Wrap K8s client in E2E with retry logic Feb 2, 2024
tsatam
tsatam previously approved these changes Feb 2, 2024
Copy link
Collaborator

@tsatam tsatam left a comment

Choose a reason for hiding this comment

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

LGTM - one minor nit but it's not a blocker

test/e2e/cluster.go Show resolved Hide resolved
test/e2e/adminapi_cluster_getlogs.go Outdated Show resolved Hide resolved
@hawkowl
Copy link
Collaborator

hawkowl commented Feb 5, 2024

/azp rerun e2e

Copy link

Command 'rerun' is not supported by Azure Pipelines.

Supported commands
  • help:
    • Get descriptions, examples and documentation about supported commands
    • Example: help "command_name"
  • list:
    • List all pipelines for this repository using a comment.
    • Example: "list"
  • run:
    • Run all pipelines or specific pipelines for this repository using a comment. Use this command by itself to trigger all related pipelines, or specify specific pipelines to run.
    • Example: "run" or "run pipeline_name, pipeline_name, pipeline_name"
  • where:
    • Report back the Azure DevOps orgs that are related to this repository and org
    • Example: "where"

See additional documentation.

@mociarain
Copy link
Collaborator Author

/azp run e2e

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mociarain mociarain requested a review from tsatam February 5, 2024 12:16
Copy link

@AldoFusterTurpin AldoFusterTurpin left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you for this @mociarain. This is a good improvement.

I just left some optional suggestion in case you find any useful.

test/e2e/adminapi_csr.go Outdated Show resolved Hide resolved
test/e2e/adminapi_redeployvm.go Show resolved Hide resolved
test/e2e/cluster.go Outdated Show resolved Hide resolved
test/e2e/helpers.go Outdated Show resolved Hide resolved
test/e2e/helpers.go Outdated Show resolved Hide resolved
test/e2e/helpers.go Outdated Show resolved Hide resolved
test/e2e/helpers.go Outdated Show resolved Hide resolved
test/e2e/helpers.go Outdated Show resolved Hide resolved
Copy link

@AldoFusterTurpin AldoFusterTurpin left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

@mociarain mociarain mentioned this pull request Feb 7, 2024
@tsatam tsatam added priority-high High priority issue or pull request ready-for-review labels Feb 7, 2024
@tsatam
Copy link
Collaborator

tsatam commented Feb 7, 2024

Marking this PR as high priority - I believe this change will go a long way towards fixing known flakes and currently-broken e2e tests such as the one being debugged in #3384

Copy link
Collaborator

@cadenmarchese cadenmarchese left a comment

Choose a reason for hiding this comment

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

Thanks a lot! I left one comment over on the other PR, it's more of a question, but we can get this merged now to help resolve e2e failures. #3388 (comment)

@cadenmarchese cadenmarchese merged commit b359efd into Azure:master Feb 7, 2024
18 checks passed
@mociarain mociarain deleted the refactor-e2e-expect-not-to branch February 8, 2024 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority-high High priority issue or pull request ready-for-review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants