Repository navigation
WIP/parallel backed digital devices - #833
IAmNickNack wants to merge 8 commits into
Conversation
|
I saw the build tests fail same as your PR. Built with -DskipTests
|
|
Thanks @taartspi This looks like a context close problem. I'll get this resolved |
40ffc11 to
b064128
Compare
|
I've updated the shutdown logic, so the tests should now only fail because of debounce tolerance. I see the eventing now working. I do get intermittent failures with the reported time being 10 or 15 ms outside tolerance. "Generally" the tests appear to work for me with (no software debounce). I've resolved some of the test errors, but not necessarily made failing tests pass. I think the errors are a result of an expectation that device implementations will maintain an internal representation of the state. If this is the case, I'd question these cases being valid unit tests for FFM. This would be something more appropriate to expect of the mock. Obviously we'd resolve these issues if this was a PR I expect to be merged. @taartspi would you mind re-retesting with the latest commit? |
I think this could be to be expected. I'm not sure hardware/kernel debounce is really intended for debounce of 1,000,000 microseconds. I imagine that there could be skew which is proportional to the duration. A lower (more realistic) debounce would likely not be so obvious/noticeable. |
|
Oct 29 PR 833 Running these three tests together, 1 out of 5 runs the MultipleListener test fails. Whether the debounceTime test passed or failed does not change this result. Running MultipleListener alone two dozen times no failure. PS The debounceTime test tolerance is another discussion. It is intended only for HW and real providers (FFM) and not mocks. We can talk later on what pi4j changed and how the test should change. |
|
Hmm ... I get different results: Does |
bb327ff to
6f5c80f
Compare
# Conflicts: # pi4j-core/src/main/java/com/pi4j/io/gpio/parallel/ParallelPortConfig.java
6f5c80f to
615446a
Compare
|
I still see a fail. I included how I create the environment in case you want different steps. |
|
In this latest, I see it's the first test which is failing on an issue with pin 27. Up until this point, none of the smoke tests will have had an opportunity to request and not release this pin, so it looks unrelated to the code change. Maybe your device has something assigned to it by the kernel. What does If you change the bcm values for the digital tests to alternative pins, does that make a difference? The parallel test uses the pairs:
Edit: Apologies if I've misread the output pasted above. I would though suggest two things:
|
|
Ah .. Finally, I now see the same error: Interesting that pin 22 doesn't fail 🤔 Also, I wonder if the preceding test has had problems releasing the line |
|
|
I have now seen your error. It appears to be very intermittent for me though. However, I think I may have found the problem: This error quite reliably appears for every test. This is logged because the poller is attempting to read from a file descriptor which is closed during the timeout period for the event watcher's call to It looks like there's a race condition during the shutdown logic. I.e. setting the There are probably multiple fixes for this, but the quick and dirty one I have pushed introduces a delay equal to the poll timeout when At least for me, this avoids the I wonder if software debounce may introduce a slight delay which causes this not to happen when it is enabled. |



Sharing this as only draft PR for demonstration purposes. I'm not (yet) proposing that we lose
FFMDigital*devices. Only sharing the idea to maybe provoke discussionThis PR provides
ParallelPortwrappers forDigital*devices, potentially negating the need for distinct digital implementations.Currently the
ParallelPortdoes not implement software debounce. However, when using this context and the change proposed in #832,DigitalInputDebounceTimeTestCaseandDigitalInputDebounceCountTestCaseappear to complete successfully with no software debounce.It would be very helpful if I could get a second opinion on this. Maybe somebody else can pull this branch and also run the smoke tests.