Skip to content

Conversation

@faern
Copy link
Owner

@faern faern commented Aug 30, 2022

Just after publishing 0.1.4 I realized that the try_recv method did not properly handle being in the UNPARKING state. I wrote a loom based test proving this was the case, then I fixed the issue. I added a bunch of more loom tests while at it. Verifying that a lot of other poll interactions act sanely.

Ping @Cassy343. What do you think? There are too many combinations on how one can call this library right now. To be fully correct we should also have tests trying to call recv, recv_timeout etc after polling also. But that's going to explode in number of tests. This will be mitigated with 0.2 where these call combinations are no longer possible.


#[cfg(feature = "async")]
#[test]
fn poll_then_try_recv_while_sending() {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the test catching the actual bug. The rest was just added for extra caution.

@Cassy343
Copy link
Contributor

Yeah good catch there. To be honest I wouldn't worry too much about these degenerate cases since they're already stemming from a pretty substantial misuse of the library, and because as you mentioned these will be fixed by the end of next month.

@faern faern merged commit 6655e8f into main Aug 31, 2022
@faern faern deleted the fix-try-recv branch September 10, 2023 18:14
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