Table of Contents

Class JobStorageConformanceSuite

Namespace
Millrace.Storage.Verification
Assembly
Millrace.Storage.Verification.dll

The workflow-checkpoint clause of the atomicity contract (ARCHITECTURE.md §4.2, §6.2).

public abstract class JobStorageConformanceSuite
Inheritance
JobStorageConformanceSuite
Inherited Members

Remarks

The checkpoint is the unit of exactly-once progress, so what matters is not that it works but that it is indivisible from the transition carrying it. Every fact here is about a partial application that must be impossible: an instance advanced by a job that did not complete, a job completed without its instance advancing, or either surviving a rejection.

Fields

Epoch

The instant every suite's fake clock starts at.

Lease

The lease length the suite claims with unless a fact needs another.

Properties

DummyInvocation

A placeholder invocation, since no conformance fact executes a job.

Methods

A_checkpoint_for_a_missing_instance_rolls_back_the_whole_transition()
A_fence_rejection_leaves_the_instance_untouched()
A_stale_checkpoint_revision_rolls_back_the_whole_transition()
A_transition_without_a_checkpoint_still_behaves_as_before()
Activate_moves_only_due_jobs_oldest_first_respecting_batch_size()
Activation_breaks_due_time_ties_by_enqueue_order()
Active_children_shield_their_descendants_from_the_cancel_cascade()
Apply_enqueue_insert_with_duplicate_active_key_is_skipped_as_noop()
Apply_enqueue_inserts_commit_atomically_with_the_transition()
Apply_failed_schedules_retry_and_activation_makes_it_claimable()
Apply_is_all_or_nothing_when_an_enqueue_insert_fails()
Apply_release_returns_job_to_queue_without_consuming_retry_budget()
Apply_succeeded_sets_terminal_fields()
Apply_with_wrong_attempt_is_rejected_without_changes()
Apply_with_wrong_worker_is_rejected_without_changes()
Apply_zombie_versus_new_owner_exactly_one_wins()
Awaiting_insert_after_parent_cancellation_is_fixed_up_to_cancelled()
Awaiting_insert_after_parent_death_is_fixed_up_to_cancelled()
Awaiting_insert_after_parent_succeeded_is_fixed_up_to_enqueued()
Awaiting_insert_with_missing_parent_throws_and_rolls_back_the_batch()
Awaiting_inserts_racing_parent_terminal_apply_never_strand_a_child(bool)
Checkpoint_transition_and_enqueue_all_commit_together()
ClaimOneAsync(IJobStorage, string, string, TimeSpan?)

Claims exactly one job, asserting that exactly one came back.

Claim_is_exclusive_under_contention()
Claim_only_returns_requested_queues()
Claim_order_is_priority_desc_then_fifo_across_queue_union()
Claim_returns_at_most_max_count()
Claim_sets_processing_worker_lease_and_increments_attempt()
Concurrent_activation_activates_each_job_exactly_once()
Concurrent_branch_checkpoints_have_exactly_one_winner()
Concurrent_same_key_enqueues_yield_exactly_one_job()
CreateHarnessAsync(TimeProvider)

Creates a fresh, empty store bound to time.

Duplicate_active_key_is_a_noop_returning_the_existing_id()
EnqueueOneAsync(IJobStorage, JobRecord)

Enqueues one job and reads it back as the provider stored it.

Enqueue_batch_with_duplicate_job_id_throws_and_persists_nothing()
Enqueue_racing_terminal_release_always_returns_a_valid_id()
Enqueue_returns_effective_ids_positionally()
Expired_lease_is_reclaimable_and_increments_attempt()
GetDueRecurring_returns_due_only_within_batch_limit()
GetJob_roundtrips_every_field()
Job(TimeProvider, JobState, string, int, string?, string?, JobId?, DateTimeOffset?, Retry?)

Builds a job record with everything defaulted except what a fact is about.

Key_uniqueness_is_scoped_per_tenant_with_null_as_its_own_scope()
NewTime()

A fake clock starting at Epoch.

Parent_death_cancels_the_transitive_awaiting_closure_and_releases_keys()
Parent_success_activates_direct_awaiting_children_only()
Recurring_upsert_roundtrips_all_fields()
Recurring_upsert_with_changed_cron_takes_the_records_next_fire_time()
Recurring_upsert_with_same_cron_preserves_next_fire_time()
Remove_recurring_removes_the_definition()
Renew_excludes_jobs_reclaimed_by_another_worker()
Renew_extends_lease_beyond_original_expiry()
Renew_resurrects_expired_but_unreclaimed_lease()
Renewal_racing_reclaim_has_exactly_one_owner()
Run_now_makes_a_retrying_job_claimable_without_spending_retry_budget()
Run_now_on_an_unknown_job_reports_false()
Run_now_refuses_anything_not_awaiting_a_retry(JobState)
Same_cron_upsert_racing_fire_never_rewinds_next_fire_time()
Scheduled_failed_and_awaiting_jobs_are_never_claimable_directly()
Terminal_key_release_is_visible_to_the_same_transitions_enqueue_inserts()
Terminal_transition_frees_the_key_but_retains_the_field()
Transition(JobRecord, JobState, int?, DateTimeOffset?, string?, bool, bool, IReadOnlyList<JobRecord>?)

Builds a transition already fenced to claimed.

TryCancel_pre_active_states_cancel_with_cascade_and_key_release(JobState)
TryCancel_processing_sets_flag_only_and_never_blocks_the_fence()
TryCancel_racing_activation_and_claim_yields_exactly_one_owner()
TryCancel_racing_fenced_apply_yields_exactly_one_terminal_outcome()
TryCancel_terminal_and_unknown_jobs_return_false_without_mutation()
TryFire_cas_has_exactly_one_winner_and_one_enqueued_job()
TryFire_unknown_id_returns_false()
TryFire_with_stale_expected_time_returns_false_and_inserts_nothing()
Unexpired_lease_blocks_reclaim()