- Notifications
You must be signed in to change notification settings - Fork81
Async CanFD via Generics#53
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Actually, I was thinking about reconsidering the implementation of the socket classes using generics all around. The amount of redundant code is starting to explode with the different runtimes and protocols being considered. I just put out a release of the Netlink stuff, and don't have a whole lot of time to keep working on this crate right now, but perhaps you folks can consider how best to use one or the other of these two PRs, and/or combine them? Then, when I swing back around to this one, we can get it all merged? @balattar do you have any comments on this? |
...and, of course, there's still a matching |
I'm not very familiar with async-std but it looks like there's already some code related to CanFdSocket in there. Is there any way we could get some form of CanFdSupport merged on the sooner side for tokio? It would be nice to be able to use this at work and not have my company maintain a fork. |
Understood, but I'm working on this crate in my spare time, and literally took a week off work this month for the Netlink stuff, so don't have a lot of unpaid time to dedicate to it at the moment. But this will definitely be in the next release when I can swing back around to it. |
Well I'd love to help out, and I don't have to take time off of work to do that :) |
I knocked out one of the other open-source crates last night, and thought to give this a try before moving on to the next one... But I'm getting intermittent failures of the unit tests. Like this:
The existing test failed once. The new FD test fails like 50% of the runs I tried. I'll look at the tests, since the original one seems flawed. But do you have any ideas? Do the tests work for you consistently? |
Oh, wait... Nevermind. I see it. The new FD tests are running in parallel (at the same time) with the old ones and they're all reading and writing to There are a couple ways to solve this, but one way we're already using is theserial_test crate, which allows you to mark a test as When I did that with the tokio tests, they all started passing consistently. Looking good. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
LGTM
@@ -256,6 +354,24 @@ mod tests { | |||
Ok(()) | |||
} | |||
#[tokio::test] | |||
async fn test_receive_can_fd() -> Result<()> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Actually, and tests interacting withvcan0 should be behind the "vcan_tests" feature, and all need to be serialized to prevent interactions. But I can add that.
Hey thanks! |
... Wish I had checked the pull requests and seen number#51 already, I wouldn't have implemented this 😬
This takes a slightly different approach in that I made the interfaces generic, not sure if you like it more or less,
so figure I should post it just in case.
I also did a stream impl and copy pasta'ed the tests and made minor tweaks.
the stream tests pass when run independently but are non-deterministic as part of cargo test, not sure if that's existing behavior.
Thanks for the library, feel free to close this or lift anything you want out of it.