Get_next_datachange: use start to compute timeout#1158
Conversation
start to compute timeoutstart to compute timeout
start to compute timeoutstart to compute timeout
|
One test does not pass: |
Using the real time and not the provided one breaks the tests
Update: it seems fine to use the |
|
It still fails the the |
|
Indeed, I was too hasty. I'm checking why. EDIT: Ah, this is because c25d916 changed slightly the semantics of next_datachange. I probably did not re-run the testsuite after this one. I'm fixing the test. |
|
@fwsmit The test is fixed in the latest revision |
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## master #1158 +/- ##
==========================================
+ Coverage 66.03% 66.04% +0.01%
==========================================
Files 46 46
Lines 7595 7601 +6
==========================================
+ Hits 5015 5020 +5
- Misses 2580 2581 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
| gint64 hours, minutes, seconds; | ||
| // Timestamp is floored to the second for display purposes -- see queues.c | ||
| gint64 t_delta = time_monotonic_now() - (n->timestamp - n->timestamp % S2US(1)); | ||
| gint64 thresholded_timestamp = n->timestamp + TURN_OF_SECOND_THRESHOLD_US; |
There was a problem hiding this comment.
I think you should subtract here. It should seem as if the notification has been sent TURN_OF_SECOND_THRESHOLD_US earlier, so that the turn of second is a little earlier (please correct me if I'm wrong)
There was a problem hiding this comment.
Actually, this is just the wrong way to do it. It is time_monotonic_now() that should be adjusted, not the n->timestamp (though both work of course, but it is way cleaner this way).
There was a problem hiding this comment.
Sorry, I notice I forgot to say that the last revision should have fixed this.
|
With the understanding of #1102 (comment), I want to suggest to split this PR up in 2 parts. One part being fixing the mixup between n->start and n->timestamp. The other part being the feature to be a bit more lenient in the required sleep duration. Are you willing to split up this PR? It should be as easy as submitting the right commits |
|
I just checked, and it seems to be totally possible. The first two commits (5525e99, cd65209) should go together in the point release, as the second one ensures that the tests are still passing; the third one (15b0941) can go in later (this is the one that tries to be clever about turns of second). I'll split the PR very soon. |
|
This third commit is dropped from this PR in the current revision. The new PR #1167 covers it. |
|
Thanks, I'm merging this now. It would be good to add a few tests to prevent issues like this and similar in the future, but I'll be making that a separate issue |
Related to issue #1102. Tested hastily, seems to fix the high CPU load.