-
Notifications
You must be signed in to change notification settings - Fork 920
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 timer mock on Incremental CAgg Refresh policy tests #7813
Use timer mock on Incremental CAgg Refresh policy tests #7813
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7813 +/- ##
==========================================
+ Coverage 80.06% 81.95% +1.88%
==========================================
Files 190 248 +58
Lines 37181 45781 +8600
Branches 9450 11466 +2016
==========================================
+ Hits 29770 37521 +7751
- Misses 2997 3750 +753
- Partials 4414 4510 +96 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
(cherry picked from commit a4c57fe)
@@ -531,6 +531,7 @@ FROM | |||
'2025-03-11 00:00:00+00'::timestamptz, | |||
'1 hour'::interval) AS t, | |||
generate_series(1,5) AS d; | |||
SET timescaledb.current_timestamp_mock TO '2025-03-11 00:00:00+00'; |
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.
Does timer mock support time zones i.e. is it set to a particular time zone?
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.
Yes it support ... it just return a TimestampTz. We do something like this in our code base:
#ifdef TS_DEBUG
Datum res = ts_get_mock_time_or_current_time();
#else
Datum res = TimestampTzGetDatum(GetCurrentTimestamp());
#endif
It means that will return the mock time if you set it, if you don't set a mock timestamp then ts_get_mock_timr_or_current_time()
will return GetCurrentTimestamp()
.
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.
But will the test interpret, say, 2025-03-11 00:00:00+00
timer mock as being in a particular time zone? I.e. will it translate to local time if run, say, in New York vs. Berlin? Is the time zone hard set in the timer mock?
The usage of timer mock was wrong because we're setting it on the current session but the job is executed by a background worker that don't have the mock time configured. Fixed it by creating a user with an specific timezone and time mock configured so any background worker created by the user will have the proper configuration. Failed attempts to fix timescale#7813 and timescale#7819.
The usage of timer mock was wrong because we're setting it on the current session but the job is executed by a background worker that don't have the mock time configured. Fixed it by creating a user with an specific timezone and time mock configured so any background worker created by the user will have the proper configuration. Failed attempts to fix timescale#7813 and timescale#7819.
The usage of timer mock was wrong because we're setting it on the current session but the job is executed by a background worker that don't have the mock time configured. Fixed it by creating a user with an specific timezone and time mock configured so any background worker created by the user will have the proper configuration. Failed attempts to fix timescale#7813 and timescale#7819.
The usage of timer mock was wrong because we're setting it on the current session but the job is executed by a background worker that don't have the mock time configured. Fixed it by creating a user with an specific timezone and time mock configured so any background worker created by the user will have the proper configuration. Failed attempts to fix #7813 and #7819.
The usage of timer mock was wrong because we're setting it on the current session but the job is executed by a background worker that don't have the mock time configured. Fixed it by creating a user with an specific timezone and time mock configured so any background worker created by the user will have the proper configuration. Failed attempts to fix #7813 and #7819. (cherry picked from commit adfda01)
The usage of timer mock was wrong because we're setting it on the current session but the job is executed by a background worker that don't have the mock time configured. Fixed it by creating a user with an specific timezone and time mock configured so any background worker created by the user will have the proper configuration. Failed attempts to fix #7813 and #7819. (cherry picked from commit adfda01)
This is an automated backport of #7813: Use timer mock on Incremental CAgg Refresh policy tests. This PR will be merged automatically after all the relevant CI checks pass. If this fix should not be backported, or will be backported manually, just close this PR. You can use the backport branch to add your changes, it won't be modified automatically anymore. For more details, please see the [documentation](https://github.com/timescale/eng-database/wiki/Releasing-TimescaleDB#automated-cherry-picking-of-bug-fixes) ## Original description ### Use timer mock on Incremental CAgg Refresh policy tests Disable-check: force-changelog-file Disable-check: approval-count Co-authored-by: Fabrízio de Royes Mello <fabriziomello@gmail.com>
Automated backport to 2.19.x not done: cherry-pick failed. Git status
|
Disable-check: force-changelog-file
Disable-check: approval-count