Skip to content
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

test(dst): add support for simulating cron schedules #189

Merged
merged 9 commits into from
Jan 8, 2024
Merged

Conversation

guergabo
Copy link
Contributor

@guergabo guergabo commented Jan 8, 2024

I played around with many more "invasive" approaches and backed off a bit after some trial and error and landed to this solution. I like this solution because it is simple yet effective for our use case.

Changes

  • logical clocks: extend the util.next() to support logical clocks not just physical clocks based on the cron schedule. Effectively eliminating real time from the system by translating minutes to ticks.
  • client-centric model: stay within the client-centric model of dst to test if schedules are being executed on time (a.k.a bulk validate within searchSchedules).
  • current tick: modify the mode.step() to capture current tick information. this helps with verification of correctness.
  • inflight cache: optimize scheduling variance by using an inflight cache (similar to notifications). there was a noticeable performance difference from < 500 to < 100 ticks variance.

@guergabo guergabo self-assigned this Jan 8, 2024
@guergabo guergabo added the enhancement New feature or request label Jan 8, 2024
Copy link

codecov bot commented Jan 8, 2024

Codecov Report

Attention: 12 lines in your changes are missing coverage. Please review.

Comparison is base (3e177b0) 64.19% compared to head (7ea2d80) 64.85%.
Report is 7 commits behind head on main.

❗ Current head 7ea2d80 differs from pull request most recent head dd5fc5f. Consider uploading reports for the commit dd5fc5f to get more accurate results

Files Patch % Lines
test/dst/model.go 60.00% 8 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #189      +/-   ##
==========================================
+ Coverage   64.19%   64.85%   +0.65%     
==========================================
  Files          83       83              
  Lines        8807     8829      +22     
==========================================
+ Hits         5654     5726      +72     
+ Misses       2772     2709      -63     
- Partials      381      394      +13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

test/dst/generator.go Outdated Show resolved Hide resolved
test/dst/dst.go Outdated Show resolved Hide resolved
@guergabo guergabo merged commit 5b5ef90 into main Jan 8, 2024
5 checks passed
@guergabo guergabo deleted the release-prep branch January 8, 2024 21:51
@guergabo guergabo mentioned this pull request Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants