-
Notifications
You must be signed in to change notification settings - Fork 761
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
Testsuite: Fix bugs in TestBuffer_Server #5666
Testsuite: Fix bugs in TestBuffer_Server #5666
Conversation
Regarding the first issue, the documentation for |
Thanks @jamshark70 Without analyzing the logic thoroughly... As I don't see these tests failing before, nor being excluded from the test suite, is the issue here that they were not catching the issues appropriately? |
This PR is addressing two issues: No. 1 -- One motivation for changing this is that, in a conversation (I forget whether it was on github or the forum), the use of
You might have thought it was going to stop, and the reset would apply to the next time it played. In fact, However... when I submitted the PR, I was trying to make minimal changes. Now I think I should do it again, and replace all of these ad-hoc timeout threads with CondVar's timeout feature. No. 2 --
Note that every one of the subtests takes a full second. Now, there's no way that generating a 512-sample buffer and retrieving it in the client should take that long. Each of these should be finishing within a few dozen milliseconds (and in fact, that's what happens with the fix here). Instead, the only reason why the test advances is because of the timeout. If we are relying on timeout logic to advance through a successful test, this is formally incorrect. Note the difference:
Note that "done" never happens in the second case! This is what's happening in test_cheby, and other places where |
Thanks you for extensive answer, it all makes sense.
Are you planning to update this PR or create a new one after this one is merged? |
Just updated 😁 -- btw, it's kind of remarkable how much more lucid the timeout logic is, when using CondVar throughout. You just |
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.
Thanks! Looks good to me.
Just to make sure - anything left here before I merge @jamshark70 ?
All right, merging |
Purpose and Motivation
Couple of things:
It was pointed out elsewhere that
aRoutine.stop.reset
is not safe -- it does not prevent double scheduling. Instead, the timeout routines in this class should be disposable -- use once, and then the next timeout should create a new routine.loadToFloatArray
must be separately forked, if it's to be used with a condition-hang. (Why?loadToFloatArray
usesforkIfNeeded
, so it will run in the test's routine. But the test's routine is being caused by the condition, soloadToFloatArray
never completes.test_cheby
was hanging because of this.)Types of changes
To-do list