-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify wait_until function and friends
The previous version of these functions worked, but I found its design was a bit over-complicated. I believe this also led to using it incorrectly, with some calls doing a "double wait_until" invocation, where an outer wait_until call in the test code used as a condition a function that itself used wait_until. This commit re-designs the wait_until function and its callers. The first difference in this new version is that the timeout and interval values always use their default values (although they can still be set by on each invocation), as in the previous version all invocations passed the same value explicitly. Secondly, instead of passing an update function and a set of arguments to call it with, we simply pass an update function, which in the caller site is bound to local arguments (using a lambda in our cases, but could be a functools.partial if required). These two changes simplified the function calling convention a bit. Finally, I've removed the "double wait_until" instances with what I believe is a correct replacement. While I'm not particularly sure I've done the right thing, I still see the same test code coverage, and all tests are still passing. This leads me to believe I did the right thing, but I will need confirmation. As a bonus, this change reduced the test walltime from ~110 seconds to ~< 60. Signed-off-by: Rodrigo Tobar <rtobar@icrar.org>
- Loading branch information
Showing
1 changed file
with
32 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters