Skip to content

test(scheduler): add schedule-store claim and retry checks - #2281

Merged
JAORMX merged 2 commits into
mainfrom
test/2273-scheduler-conformance-prerequisite
Oct 13, 2026
Merged

JAORMX merged 2 commits into
mainfrom
test/2273-scheduler-conformance-prerequisite

Conversation

@JAORMX

@JAORMX JAORMX commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

What these tests check

This PR adds a reusable test suite for schedule-store implementations: memory, JSONL, Redis, and the gRPC adapter. The tests call store methods and inspect the resulting records. They do not launch an executor or verify that a running command stops.

The new suite checks that:

  • A second claim is rejected while the same schedule's previous claim is unfinished.
  • A late result from an earlier run is saved without clearing a newer claim.
  • Two concurrent requests to re-enable the same failed one-shot produce one retry and one counter increment.
  • Retry requests for successful or unfinished runs, disabled retry policies, or exhausted budgets are rejected without changing the records.

Claim reserves a schedule occurrence in the store. ReArmOneShot re-enables a failed one-time schedule so it can be retried.

Code structure

The new entry point is scheduleconformance.RunClaimAndRetryConformance; its additional cases live in claim_and_retry.go. It shares the common tests with the existing Run entry point. The few assertions that differ are selected explicitly, without copying the entire suite.

Run retains the expectations used by existing adapters. No scheduler, store, executor, or other runtime behavior changes in this PR.

Why this comes before #2277

The scheduler fix needs these tests, but the repository requires its engine dependency to come from code already merged into main. This PR makes the test helper available first. After it merges, #2277 can pin that merged revision and use the new suite with the repaired stores.

Validation

  • CI passed on 69c76d836, including the full race suite, lint, build, docs, and MicroVM checks.
  • Existing Run passed against the current four store implementations under race detection in UTC and Europe/Helsinki.
  • The new suite passed against the repaired versions of those stores from fix(scheduler): keep polling behind stuck fires without releasing ownership #2277 in a separate validation worktree, under race detection in both timezones.
  • A subprocess test deliberately permits an overlapping claim and checks that the new suite reports that violation.
  • Local lint, documentation checks, and the complete non-race test suite passed after the terminology changes. The complete local race rerun was blocked by disk quota exhaustion while linking the unrelated MicroVM integration module; the focused race checks above passed.

Add RunExecutionFenced with the complete strengthened ownership and retry suite while preserving legacy Run expectations and all runtime behavior. This prerequisite lets the scheduler fix use a main-ancestral engine dependency.

Co-authored-by: Mecatl <[email protected]>
Replace execution-fenced terminology with concrete schedule-store operations in the helper API, file names, test diagnostics, and documentation. Explicitly distinguish record checks from executor testing without changing assertions or runtime behavior.

Co-authored-by: Mecatl <[email protected]>
@JAORMX JAORMX changed the title test(scheduler): publish execution-fenced conformance prerequisite test(scheduler): add schedule-store claim and retry checks Oct 13, 2026
@JAORMX
JAORMX merged commit 36b6ca9 into main Oct 13, 2026
37 checks passed
@JAORMX
JAORMX deleted the test/2273-scheduler-conformance-prerequisite branch October 13, 2026 10:35
JAORMX added a commit that referenced this pull request Oct 13, 2026
Pin the main-ancestral engine test helper from #2281 and switch all repaired store callers to RunClaimAndRetryConformance. Exercise standalone gRPC conformance through the repaired JSONL backend instead of the published legacy memory store.

Co-authored-by: Mecatl <[email protected]>
@toolhive-release-app toolhive-release-app Bot mentioned this pull request Oct 13, 2026
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant