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

✨ Use a separate namespace for each e2e test #1428

Merged
merged 1 commit into from
Nov 7, 2024

Conversation

tmshort
Copy link
Contributor

@tmshort tmshort commented Nov 6, 2024

Fixes #1307

Create and use a new namespace for every e2e test. This means that extension resources are placed in their own namespace. The tests deletes the namespace, and then waits until completion. This ensures that most of an extension's resources are deleted.

It does guarantee that global resources (e.g. CRDs, CRs, CRBs) are deleted.

And would eventually allow the tests to be run in parallel (assuming the installed extensions allow for that).

Description

Reviewer Checklist

  • API Go Documentation
  • Tests: Unit Tests (and E2E Tests, if appropriate)
  • Comprehensive Commit Messages
  • Links to related GitHub Issue(s)

@tmshort tmshort requested a review from a team as a code owner November 6, 2024 18:02
Copy link

netlify bot commented Nov 6, 2024

Deploy Preview for olmv1 ready!

Name Link
🔨 Latest commit c64e360
🔍 Latest deploy log https://app.netlify.com/sites/olmv1/deploys/672cef8276e9e800071036e4
😎 Deploy Preview https://deploy-preview-1428--olmv1.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Nov 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.26%. Comparing base (26904a2) to head (c64e360).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1428   +/-   ##
=======================================
  Coverage   73.26%   73.26%           
=======================================
  Files          42       42           
  Lines        3063     3063           
=======================================
  Hits         2244     2244           
  Misses        644      644           
  Partials      175      175           
Flag Coverage Δ
e2e 54.91% <ø> (-0.10%) ⬇️
unit 52.59% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tmshort
Copy link
Contributor Author

tmshort commented Nov 6, 2024

I have encountered one failure over the course of several dozen; so this is not perfect, but it does reduce the likelyhood

@tmshort tmshort force-pushed the fix-e2e-flakes branch 3 times, most recently from d940463 to 7b79ace Compare November 6, 2024 20:55
@tmshort
Copy link
Contributor Author

tmshort commented Nov 6, 2024

Of course, it failed e2e... but it failed because the bundle's CRDs were still present... not much we can do here except chase a timeout, which is never a good idea.

This was the interesting condition on the CRDs:

{Terminating True 2024-11-06 21:00:31 +0000 UTC InstanceDeletionFailed could not list instances: storage is (re)initializing}

Fixes operator-framework#1307

Create and use a new namespace for every e2e test. This means that
extension resources are placed in their own namespace. The tests
deletes the namespace, and then waits until completion. This ensures
that _most_ of an extension's resources are deleted.

It does guarantee that global resources (e.g. CRDs, CRs, CRBs) are
deleted.

And would eventually allow the tests to be run in parallel (assuming
the installed extensions allow for that).

Signed-off-by: Todd Short <tshort@redhat.com>
Copy link
Member

@LalatenduMohanty LalatenduMohanty left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 7, 2024
@tmshort tmshort added this pull request to the merge queue Nov 7, 2024
github-merge-queue bot pushed a commit that referenced this pull request Nov 7, 2024
Fixes #1307

Create and use a new namespace for every e2e test. This means that
extension resources are placed in their own namespace. The tests
deletes the namespace, and then waits until completion. This ensures
that _most_ of an extension's resources are deleted.

It does guarantee that global resources (e.g. CRDs, CRs, CRBs) are
deleted.

And would eventually allow the tests to be run in parallel (assuming
the installed extensions allow for that).

Signed-off-by: Todd Short <tshort@redhat.com>
@tmshort
Copy link
Contributor Author

tmshort commented Nov 7, 2024

Managed to get this to run 35 times in a row without a failure...

@tmshort tmshort mentioned this pull request Nov 7, 2024
4 tasks
Merged via the queue into operator-framework:main with commit 8bccc74 Nov 7, 2024
17 checks passed
@tmshort tmshort deleted the fix-e2e-flakes branch November 7, 2024 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

e2e error: already exists in namespace '' and cannot be managed by operator-controller
2 participants