Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@pabigot @andyross @nordic-krch
Since the assumption that
k_busy_wait()
andk_sleep()
are driven by the same clock is just not valid for Nordic platfroms (and likely for others as well, present or future), would it be better to introduce a newFREQUENCY_TOLERANCE
variable that the test uses to extend its tolerance and that can be set to0
for platforms that use the same clock.Then you can have something like:
check_timeout_drift()
that usesFREQUENCY_TOLERANCE
in all tests that combine busy waits with sleep.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.
@andyross could you please weigh in here?
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.
Comments in #24784 (comment) -- I'd be personally happy with this patch, or its converse.
To nitpick: I guess stylewise I'd prefer a choice of name that conveys the implication and not just the details. The important thing to an app isn't what whether the source is "SYNTH" or "XTAL", it's that the "synth" choice is subject to temperature and semiconductor process skew where the crystal is tuned to more conventional tolerances.
As far as adding code to the test framework, that would work, but it doesn't seem much different than just adding a fudge factor for individual cases. These kind of long busy waits are pretty rare even in the tests.