Skip to content
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

Test error handling for SPI code #305

Open
Tracked by #237
PatrickKa opened this issue Jun 27, 2024 · 1 comment · May be fixed by #315
Open
Tracked by #237

Test error handling for SPI code #305

PatrickKa opened this issue Jun 27, 2024 · 1 comment · May be fixed by #315

Comments

@PatrickKa
Copy link
Contributor

PatrickKa commented Jun 27, 2024

Description

We should at least test the happy path. I think the easiest for this would be to DEBUG_PRINT() the results of the startup tests and every time the supervisor detects an error. Then we write a test where we write to all SPIs one after another and confirm that the supervisor does not interfere.

Unfortunately, it is hard to test the sad path. Just decreasing the timeout doesn't work because the supervisor thread is not executed frequently enough to reliably catch such small timeouts. After all, it is supposed to check if the SPI is completely hung up. For that, we would need to make the SPI communication super slow as well.

Something we definitely need to and are able to test is whether the whole sleeping and resuming of the startup test threads works as planned.

@PatrickKa
Copy link
Contributor Author

For testing the sad path we need to mock the flash code, create stubs for the startup tests and enable the Spi class to run on Linux (probably with PImpl and a mock). This means that this issue is also related to #209.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants