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

fix: windowwithtimeorcount thread unsafe #700

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fanck0605
Copy link

@fanck0605 fanck0605 commented Sep 18, 2023

We expect them to be equal, but they are not

result = []
(
    reactivex.range(100_000)
    .pipe(
        operators.buffer_with_time_or_count(timespan=0.001, count=10_000),
    )
    .subscribe(on_next=lambda x: result.extend(x))
)
print(f"len(result) = {len(result)}")
assert result == [*range(100_000)]

Result:

len(result) = 99986
Traceback (most recent call last):
  File "D:\Projects\效能提升\rxdemo\test_retry.py", line 16, in <module>
    assert result == [*range(100_000)]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError

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.

1 participant