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

Remove calls to time.Sleep() from operator tests #140

Open
invidian opened this issue Feb 22, 2022 · 1 comment
Open

Remove calls to time.Sleep() from operator tests #140

invidian opened this issue Feb 22, 2022 · 1 comment
Labels
component/operator Operator-related issues tech-debt

Comments

@invidian
Copy link
Member

Those calls are suboptimal and not interruptable. We should instead add some hooks to fake client to inform us when certain events occur and proceed then.

@invidian invidian added tech-debt component/operator Operator-related issues labels Feb 22, 2022
@invidian
Copy link
Member Author

invidian commented Feb 23, 2022

Interesting observation:

  • Rewriting tests to use events-based approach makes tests more fragile, as they are more implementation specific. Sleep based tests are more implementation agnostic.
  • Optimizing sleep based tests (so basically reducing both cycle and wait times) may make tests more sensitive to CPU stalls, where process waits for CPU time to be given, which might be particularly problematic on public cloud CI.

I'm on the fence which approach is more appropriate here then. Though given that the tests takes 5 seconds to run right now, it's not a huge problem, though agent tests takes 1.5 second for example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/operator Operator-related issues tech-debt
Projects
None yet
Development

No branches or pull requests

1 participant