Skip to content

Failing unit test on micros() ? #259

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

Closed
RobTillaart opened this issue Jan 1, 2021 · 3 comments
Closed

Failing unit test on micros() ? #259

RobTillaart opened this issue Jan 1, 2021 · 3 comments

Comments

@RobTillaart
Copy link

RobTillaart/ML8511#1

This line causes an eternal hang. I suspect that micros() is not incremented but yield() is my second suspect.

while (micros() - start < 1000) yield(); 
@ianfixes
Copy link
Collaborator

ianfixes commented Jan 2, 2021

I think this is a duplicate of #241

@RobTillaart
Copy link
Author

Yes seems so. (So can be closed)
Small delays are often loops waiting for a clock to proceed. As I run in it again the priority increased a bit (or more)

Think a timeout on unit test level has highest prio as it will be valuable for any test.
Default max 60 seconds per individual unit test seems reasonable start. Godmode could set / change it,

Implementing micros might be harder, but would allow more and better testing. E.g. communication handshakes with sensors which is a great part of my libraries.

@ianfixes
Copy link
Collaborator

ianfixes commented Jan 2, 2021

Understood. This is one facet of a much larger issue, which is "how to make the dummy hardware more like actual hardware" -- with time passing, some outputs affecting other inputs, etc.

The most important thing for me to get right in all of that is having something that (1) works for the majority of cases with minimal configuration and (2) works for special cases with whatever configuration it takes. So I'm definitely taking my time there. See #145

@ianfixes ianfixes closed this as completed Jan 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants