-
Notifications
You must be signed in to change notification settings - Fork 49
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
Use CallFnAfter instead of CallOnConditionKeep #3841
Conversation
This is fine as a workaround. And ok since its not a critical issue. But I think we should fix the "round number" approximation. |
Also : I am pasting your *=(Ritvik's) explanation from slack here: |
It would be better to either 1) fix the test to work for CcdCallOnConditionKeep, or 2) remove CcdCallOnConditionKeep from the test entirely. Leaving it commented out and known to be broken is bad and may confuse someone later looking for an example of how CcdCallOnConditionKeep works. |
As to this test itself is concerned, I am ok with option 2 that Sam listed. (remove CcdCallOnCondition) and all the associated ifdefs). Its bogus to base it on the "has a bunch of 0's after decimal" to determine close-enough-to-one. And also to assume that startup will be close to 0. |
I pushed a fix to make this work for both ConditionKeep and CallAfter. To be clear, there are no problems with either of these methods, and they work as expected. The issue is that ConditionKeep triggers a function every second starting from 0 (so 1.0, 2.0, 3.0, etc), instead of starting from the moment ConditionKeep is called, which differs from how CallAfter works. I would argue that the original version of the test doesn't make sense for ConditionKeep, since it assumes that CkWallTimer starts at 0. So I just added an ifdef saying that if we're using ConditionKeep, set the start time to 0, not CkWallTimer. |
ok. I like that and is correct to the intent of the test. (Which may be testing for some really rare malady in timers.. but ok). |
Tom hasn't had a recently merged PR though. |
In order to get recent failing test cases to pass so we can merge PRs, I changed the periodic test to use CcdCallFnAfter, not CcdCallOnConditionKeep, which means the test will pass regardless of the value of CkWallTimer in the mainchare of periodic.C.