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

🌱 Add test for fetching bundles #951

Merged

Conversation

m1kola
Copy link
Member

@m1kola m1kola commented Jun 17, 2024

Description

Cover what happens when we fail to fetch bundles from catalog.

This should solve flaky test coverage. It looks like in E2E we sometimes are hitting this condition and sometimes we don't which results in coverage fluctuation:

Screenshot 2024-06-17 at 16 37 28

Reviewer Checklist

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

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 17, 2024
Copy link

netlify bot commented Jun 17, 2024

Deploy Preview for olmv1 ready!

Name Link
🔨 Latest commit cd4084b
🔍 Latest deploy log https://app.netlify.com/sites/olmv1/deploys/6673f1e00f968500084ec927
😎 Deploy Preview https://deploy-preview-951--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 Jun 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.14%. Comparing base (bfd4142) to head (cd4084b).
Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #951   +/-   ##
=======================================
  Coverage   80.14%   80.14%           
=======================================
  Files          16       16           
  Lines        1103     1103           
=======================================
  Hits          884      884           
  Misses        152      152           
  Partials       67       67           
Flag Coverage Δ
e2e 58.20% <ø> (ø)
unit 54.03% <ø> (+0.18%) ⬆️

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.

@m1kola m1kola marked this pull request as ready for review June 17, 2024 14:43
@m1kola m1kola requested a review from a team as a code owner June 17, 2024 14:43
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 17, 2024
@m1kola m1kola enabled auto-merge June 17, 2024 15:40
Cover what happens when we fail to fetch bundles from catalog.

Signed-off-by: Mikalai Radchuk <mradchuk@redhat.com>
@m1kola m1kola force-pushed the cluster_extension_reconcile_test branch from 76d282b to cd4084b Compare June 20, 2024 09:09
@m1kola m1kola requested a review from tmshort June 20, 2024 09:10
@joelanford
Copy link
Member

It looks like in E2E we sometimes are hitting this condition and sometimes we don't which results in coverage fluctuation

Adding more test coverage is good, but it seems pretty bad that other e2e tests are non-deterministic in this way. Did you dive into this enough to understand why the flakiness is happening?

@m1kola
Copy link
Member Author

m1kola commented Jun 21, 2024

@joelanford Here is what I think happens:

  1. We create a catalog.
  2. We run a test.
  3. We sometimes hit "error fetching bundles" and sometimes not. When we do hit it - it gets coverage.
  4. E2Es wait for a certain condition and which gives the controller a chance to requeue the reconcile request. Eventually reconcile succeeds.

I think error happens because in tests we create catalogs and we do not wait for them to become ready: we create ClusterExtension immediately after creating a ClusterCatalog. So most likely ClusterExtension controller attempts to reconcile while catalog is still unpacking/not ready.

We can look into adding waits after creating ClusterCatalog, but IMO it is good that we do not have these artificial waits: we should be able to reconcile once catalog becomes ready.

@joelanford
Copy link
Member

+100000 to not artificially wait. Expecting eventual consistency in our e2e's is the correct approach.

This makes sense. Thanks for the explanation.

Copy link
Contributor

@tmshort tmshort left a comment

Choose a reason for hiding this comment

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

/lgtm

@m1kola m1kola added this pull request to the merge queue Jun 24, 2024
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jun 24, 2024
Merged via the queue into operator-framework:main with commit 6c61a78 Jun 24, 2024
17 checks passed
@m1kola m1kola deleted the cluster_extension_reconcile_test branch June 24, 2024 13:34
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.

None yet

3 participants