Skip to content

Commit

Permalink
tests: net: conn_mgr_monitor: Improve test reliability under heavy load
Browse files Browse the repository at this point in the history
conn_mgr_tests were occasionally failing when executed under heavy load.
The reason for this are short timeout values used when waiting for
events - if executed under heavy load, the even might not be delivered
on time.

An obvious solution would be to simply increase the timeout, however
when testing it turned out the actual timeout value would need to be
pretty high to ensure tests reliability. Therefore, to avoid
unnecessary increase of the overall test execution time to protect
against rare edge cases, rework the event waiting mechanism to use
semaphore instead. The test cases will now specify the events they're
waiting for, and the event handlers will feed the semaphore if all
expected events have been delivered. This allows the increase the
maximum timeout when waiting for events, w/o affecting too much the test
execution time under normal conditions.

Signed-off-by: Robert Lubos <[email protected]>
  • Loading branch information
rlubos authored and carlescufi committed Oct 15, 2024
1 parent a285b8a commit 45a79d3
Showing 1 changed file with 109 additions and 37 deletions.
Loading

0 comments on commit 45a79d3

Please sign in to comment.