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

perf(test_utils): replace sleep with async queue join when stopping test stream #78

Merged
merged 1 commit into from
Nov 23, 2022

Conversation

JeroennC
Copy link
Contributor

TestStreamClient uses async queues in the background, which can be awaited for all processing to be done. This speeds up tests starting and stopping the TestStreamClient by removing the 1s sleep.

An assumption is made to call task_done in the TestConsumer.getone, as there is no callback towards the consumer after processing a record. I believe the existing test cases should still be sufficient, please let me know if you see some edge cases where this would not work or needs extra testing.

…est stream

TestStreamClient uses async queues in the background, which can be awaited for all processing to be done. This speeds up tests starting and stopping the TestStreamClient by removing the 1s sleep.
@JeroennC JeroennC force-pushed the test-utils-remove-sleep branch from c4b968f to 95babab Compare November 15, 2022 09:14
@codecov-commenter
Copy link

Codecov Report

Merging #78 (95babab) into master (b4dd516) will increase coverage by 0.40%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master      #78      +/-   ##
==========================================
+ Coverage   95.53%   95.93%   +0.40%     
==========================================
  Files          16       16              
  Lines         381      394      +13     
==========================================
+ Hits          364      378      +14     
+ Misses         17       16       -1     
Flag Coverage Δ
unittests 95.93% <100.00%> (+0.40%) ⬆️

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

Impacted Files Coverage Δ
kstreams/test_utils/test_clients.py 97.43% <100.00%> (+0.25%) ⬆️
kstreams/test_utils/test_utils.py 97.87% <100.00%> (-0.05%) ⬇️
kstreams/test_utils/topics.py 94.20% <100.00%> (-0.96%) ⬇️
kstreams/prometheus/tasks.py 100.00% <0.00%> (+9.09%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@woile woile requested a review from marcosschroh November 15, 2022 09:20
@marcosschroh marcosschroh merged commit 4cffa7a into kpn:master Nov 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants