-
Notifications
You must be signed in to change notification settings - Fork 2k
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
tests/stdin: fix automatic test on slow platforms #12816
Conversation
The issue reported by Murdock on nrf52dk is unrelated. |
Wouldn't it be more stable to wait for a trigger? It is clear that the python script should not try to send Waiting one second might fail depending on test machine load. On platforms that can be reset while the terminal is open (e.g., all CI boards), all output after reset is captured. |
This was indeed the first option I tried (and it worked). But after discussing this IRL with @fjmolinas, we thought the small delay was simpler (I don't remember the exact reasons in fact). |
Ok. Let's see if this solves it on esp32 (all other CI boards are fast enough). |
It seems that it's the case: #11449 (comment) |
We had talked about not using The issue with syncing on a print is that if the application prints before the python script is capturing it will never sync correctly. A better fix might be to try multiple times to send the character, same as in |
@aabadie thoughts on my latest comment? (since you re-requested the review) |
Yes, 2:
Maybe we could go for 1. since it will really test the feature, with a very minimal setup. |
Instead of the current status? I just think its a better fix |
I meant do we really need |
I think you do, there is not test for |
Ok let's do as you suggested, e.g. point 1. |
Whats the state here? #11449 is waiting for this. |
We could merge as is and improve later. |
I only commented on the PR, no changes request, so it is @aabadie call. |
During my last tests on arduino-uno, I wasn't able to reproduce the issue, even on master. But maybe that was something weird with the fuses. I need to investigate this more but won't have the hardware with me before next week. |
@kaspar030 is this fixing the issue for esp32? |
If it does we could just go as is just fix the commit message. I would still like the test to be improved, but it can be done later. |
yes! |
242b35e
to
a0e7ecd
Compare
I pushed an update that makes the test even more robust. It should work on AVR (couldn't test yet) and works well on esp32-wroom-32 and hifive1b (also broken on master). If @fjmolinas is fine with the current state, I think this PR can be merged. |
The test application now prints in a loop the input character. In case stdin is not ready yet after startup this lets the possibility to try to send several time a character before failing. The automatic test is now more robust on platforms where stdin takes time before it gets in a ready state (some AVR, hifive).
a0e7ecd
to
a4c3d73
Compare
I haven't tested, but changes look. |
Tested on arduino-uno:
|
@kaspar030 can you test on |
works fine on esp32-wroom-32! |
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.
ACK!
Contribution description
This PR fixes the stdin tests on slow plaform. It could have been fixed with #12461 but as @fjmolinas told me IRL, it's a bit weird to use the feature tested by the test to sync the test.
The solution is proposed by this PR is then to add a small delay in the Python test script before it send the character that is testing stdin.
Testing procedure
The following command should succeed on supported platforms, including AVR based boards:
Issues/PRs references
Could have been added to #12651