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

Producer: Rewrite non enabled unit tests #272

Merged
merged 4 commits into from
Feb 28, 2022

Conversation

cbrand
Copy link
Contributor

@cbrand cbrand commented Feb 22, 2022

Description

During the implementation of #270 I realized that a couple of unit tests inside of the tests/unit/transport/test_producer.py doesn't do anything due to early return statements.

This PR adjusts all the tests to check for expected behavior which did not run correctly before.

Open Question is the flush_atmost function. Due to the event set wait method, it cannot be guaranteed that during the flush operation that there are at max the max_messages of sent events being sent. According to the function name and the previous test, however, this is the intended behavior.

I adjusted the test accordingly and just expect that messages are sent out, as there doesn't seem to be a reasonable primitive to fulfill the existing expectation within the test.

@cbrand
Copy link
Contributor Author

cbrand commented Feb 23, 2022

@patkivikram hopefully fixed the formatting issues (i only ran black on the faust repository and not the tests repository accidentally).

@patkivikram
Copy link
Collaborator

@cbrand can you resolve the conflicts?

@cbrand
Copy link
Contributor Author

cbrand commented Feb 25, 2022

Yes, will do and I will get back to you.

@codecov-commenter
Copy link

codecov-commenter commented Feb 27, 2022

Codecov Report

Merging #272 (34ba377) into master (784bee7) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #272   +/-   ##
=======================================
  Coverage   94.71%   94.71%           
=======================================
  Files         100      100           
  Lines       10842    10842           
  Branches     1481     1481           
=======================================
  Hits        10269    10269           
  Misses        500      500           
  Partials       73       73           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 784bee7...34ba377. Read the comment docs.

@cbrand
Copy link
Contributor Author

cbrand commented Feb 27, 2022

@patkivikram done. Please check.

I also realized that it seems that the ThreadedProducer isn't tested at all as it would currently fail in Python 3.6 (as it uses asyncio.create_task). See: #277 for a potential solution there.

@patkivikram patkivikram merged commit d15d349 into faust-streaming:master Feb 28, 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