Closed yiancar closed 3 years ago
To clarify, did you actually plug and unplug USB devices as it was going (the tests require some manual interaction)? It looks like maybe given the rest of them passed.
armv7l
isn't a platform I am going to be able to test and support myself. Feel free to send a PR if you want to dig into it.
I have indeed yes. I have also tried using the 2 suggested PRs to stop it from segfaulting on Linux. That part has worked.
I will try my best to try and figure it out
Interestingly, if you are able to give any pointers, I have noticed the following:
Tests that start with remove a USB device, fail if I first insert a device before removing it. Is this what it should happen? Or should the module be able to detect the new device and then detect that it has been removed?
@yiancar I think it should work. I haven't had any issues testing on Windows or macOS when I just plug and unplug the same USB device over and over.
This was all incorrect, this module works fine on raspian :)
@yiancar For future onlookers, can you explain how you came to this realization? What's different from when you originally posted to now?
Of course. In my case usb-detection is a module used under a program I was debugging. In general this program is suppose to execute some code when a device is plugged/unplugged. This was not happening on the Pi the majority of the times.
After running the test suite, some of the test were failing as seen above. The tests expect that a detection will happen within 10 seconds. It seems the Pi can be a bit slow and sometimes it takes around 10 seconds for the detection to happen, adding that up with the initial time it takes to plug/unplug a device and we have a false failure.
Increasing the test timeout time lets all the tests pass on a Pi. Also manually creating a program that print detentions showed that all devices, sometimes after a bit of a delay, get detected.
Cheers
After compiling the module for armv7l, I run the test which failed on device disconnect: