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

RHOAIENG-15772: tests(odh-nbc) significantly reduce the amount of sleeping in tests #465

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

jiridanek
Copy link
Member

@jiridanek jiridanek commented Nov 17, 2024

https://issues.redhat.com/browse/RHOAIENG-15772

Relates to

Description

  • remove time.sleep()s and rely on Eventually
  • shorten the interval constant so that we check more frequently
  • leaving one sleep that seems necessary for the tests (!)
  • and two more sleeps that are a workaround for flakyness

This PR depends on

because with the caching client, a check for resource passes (resource is in cache) but server-side patching fails (resource is not yet on server). For example this one

patch := client.RawPatch(types.MergePatchType, []byte(`{"spec":{"to":{"name":"foo"}}}`))
Expect(cli.Patch(ctx, route, patch)).Should(Succeed())

and also the create-get does not work well

By("By creating a new Notebook")
Expect(cli.Create(ctx, notebook)).Should(Succeed())
By("By updating the Notebook's image")
key := types.NamespacedName{Name: Name, Namespace: Namespace}
Expect(cli.Get(ctx, key, notebook)).Should(Succeed())

How Has This Been Tested?

make test

Merge criteria:

  • The commits are squashed in a cohesive manner and have meaningful messages.
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has manually tested the changes and verified that the changes work

Copy link

openshift-ci bot commented Nov 17, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from jiridanek. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@jiridanek jiridanek changed the title wip: remove sleeps in tests RHOAIENG-15772: tests(odh-nbc) significantly reduce the amount of sleeping in tests Nov 24, 2024
@jstourac
Copy link
Member

/lgtm

@jiridanek
Copy link
Member Author

This makes the tests more flaky than they are now, so I plan to sit on it a while, until I get other (more important) things merged in opendatahub-io/notebooks.

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.

2 participants