Skip to content

tests/misc/cexample_class: Fix timing sensitivity. - #10072

Merged
dpgeorge merged 2 commits into
micropython:masterfrom
pybricks:user-type-example
Nov 25, 2022
Merged

dpgeorge merged 2 commits into
micropython:masterfrom
pybricks:user-type-example

Conversation

@laurensvalk

@laurensvalk laurensvalk commented Nov 24, 2022 •

Copy link
Copy Markdown
Contributor

This test could occasionally fail because some operations take longer than expected. This relaxes the timing constraints and defers printing until the very end.

Signed-off-by: Laurens Valk [email protected]


This fixes a follow-up issue raised in #10038


Edit: While we are looking at this code, I've also added the Timer to the cexample module test.

@damz

damz commented Nov 24, 2022

Copy link
Copy Markdown
Contributor

Looks good to me 👍

Comment thread tests/misc/cexample_class.py Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about a lower bound of SLEEP_MS - TOLERANCE_MS?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Updated.

Now that the Timer class has been merged in a separate pull request,
this can be added to the module test too.

Signed-off-by: Laurens Valk <[email protected]>
This test could occasionally fail because some operations take longer
than expected. This relaxes the timing constraints and defers printing
until the very end.

Signed-off-by: Laurens Valk <[email protected]>
@dpgeorge
dpgeorge merged commit 3c1a2a9 into micropython:master Nov 25, 2022
@dpgeorge

Copy link
Copy Markdown
Member

Thank for updating. Merged.

@laurensvalk
laurensvalk deleted the user-type-example branch November 25, 2022 11:50
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

Successfully merging this pull request may close these issues.

3 participants