-
Notifications
You must be signed in to change notification settings - Fork 1
Add Time-Series builder & timestamp I/O tests (#266) #269
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
base: main
Are you sure you want to change the base?
Conversation
3 files changed, 1020 insertions(+), 3 deletions(-) Automated changes made by octoaide bot.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #269 +/- ##
===========================================
+ Coverage 10.19% 20.60% +10.41%
===========================================
Files 8 7 -1
Lines 628 529 -99
===========================================
+ Hits 64 109 +45
+ Misses 564 420 -144 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
The generated test code seems to be failing due to interference caused by shared global state ( |
|
I analyzed the failing tests and found they were flaky because tests were colliding on the shared global state (LAST_TRANSFER_TIME) when run concurrently. I’ve committed and pushed fixes that make each test self-contained so they no longer interfere with one another. What I changed
Result
Thanks for the report — the interference issue is resolved and the fixes are pushed. |
|
Please add test cases for
|
|
I analyzed your feedback and implemented the requested tests for SamplingPolicyExt::start_timestamp(). I've committed and pushed the changes. What I changed
Why this addresses the feedback
Status
Thanks for the suggestion — let me know if you want additional edge cases added or any adjustments to the test inputs. |
src/subscribe/time_series.rs
Outdated
| #[test] | ||
| fn test_time_slot_period_not_divisible_by_interval() { | ||
| // Period: 1 hour (3600s), Interval: 7 min (420s) => 8 slots (3600/420 = 8.57 truncated) | ||
| // This tests the edge case where period % interval != 0 |
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.
In the current normal flow, the interval value can only be 5 minutes, 10 minutes, 15 minutes, 30 minutes, or 1 hour, and the period value can only be 6 hours, 12 hours, or 24 hours, so period % interval == 0 is always guaranteed.
However, to guard against potential issues in case this assumption is broken due to future changes in error codes or validation logic, it would be good to add a defensive check.
Please update the try_new function in time_series.rs to return an error when period % interval != 0.
|
I looked at your suggestion and added a defensive check to time_series.rs as requested. I updated try_new to validate that period is evenly divisible by interval (period % interval == 0) at the start of the function and return an error if the check fails. This ensures we fail fast with a clear error instead of producing incorrect time series if future changes relax the current constraints on allowed period/interval combinations. I've committed and pushed the change, and all 36 time_series tests pass locally in the CI run. Thanks for the catch — this should guard us against the class of future-validation regressions you mentioned. |
123d9b7 to
1cf6ee8
Compare
|
The following changes have been applied to Octoaide’s PR:
|
|
The following changes have been added.
|
981441b to
8b89fb2
Compare
This PR adds comprehensive unit tests for the Time-Series builder and JSON-based last-timestamp persistence to satisfy the scope of issue #266.
What changed
Why
Notes
Closes #266