fix(job): correct amount of jobs + remove cound due to grace window

This commit is contained in:
Edouard Vanbelle
2026-07-30 01:33:13 +02:00
parent 5a87999949
commit d3c2fc3e94
2 changed files with 26 additions and 17 deletions
+17 -13
View File
@@ -90,13 +90,14 @@ jsonpath "$..interval_ms" count == 3
# Every entry carries a `running` bool — same aggregate primitive. # Every entry carries a `running` bool — same aggregate primitive.
# Count matches the registered-tenant count: 4 Part 1 periodics # Count matches the registered-tenant count: 4 Part 1 periodics
# (trash_cleanup, storage_reconcile, dedup_gc, grant_cleanup) + 3 # (trash_cleanup, storage_reconcile, dedup_gc, grant_cleanup) + 5
# Part 2 recoverables (drives_consistency, folders_consistency, # Part 2 recoverables (drives_consistency, folders_consistency,
# files_consistency — wrapped by RecoverableAdapter so they appear # files_consistency, blobs_consistency, backend_consistency —
# here alongside the periodics) + 1 coordinator (consistency_batch # wrapped by RecoverableAdapter so they appear here alongside the
# — a plain JobHandler that dispatches every registered # periodics) + 1 coordinator (consistency_batch — a plain
# `*_consistency`). Bump when a new tenant registers. # JobHandler that dispatches every registered `*_consistency`).
jsonpath "$..running" count == 8 # Bump when a new tenant registers.
jsonpath "$..running" count == 10
jsonpath "$[*].name" contains "drives_consistency" jsonpath "$[*].name" contains "drives_consistency"
jsonpath "$[*].name" contains "folders_consistency" jsonpath "$[*].name" contains "folders_consistency"
jsonpath "$[*].name" contains "files_consistency" jsonpath "$[*].name" contains "files_consistency"
@@ -214,11 +215,12 @@ jsonpath "$.outcome.count" exists
# Step 4c — Trigger `consistency_batch`. Coordinator (plain # Step 4c — Trigger `consistency_batch`. Coordinator (plain
# JobHandler) — snapshots the registry, filters names # JobHandler) — snapshots the registry, filters names
# ending `_consistency`, sequentially triggers each. # ending `_consistency`, sequentially triggers each.
# `outcome.count` = number of children dispatched (3 as # `outcome.count` = number of children dispatched (5 as
# of Slice 6: drives + folders + files). `extra.per_check` # of Slice 10: drives + folders + files + blobs +
# carries a per-child outcome map. Batch itself always # backend). `extra.per_check` carries a per-child outcome
# returns ok — child failures live inside per_check. # map. Batch itself always returns ok — child failures
# `?deep=true` propagates as `extra.deep`. # live inside per_check. `?deep=true` propagates as
# `extra.deep`.
# ───────────────────────────────────────────────────────────── # ─────────────────────────────────────────────────────────────
POST {{base_url}}/api/admin/jobs/consistency_batch/trigger?deep=true POST {{base_url}}/api/admin/jobs/consistency_batch/trigger?deep=true
Authorization: Bearer {{admin_token}} Authorization: Bearer {{admin_token}}
@@ -227,14 +229,16 @@ HTTP 200
[Asserts] [Asserts]
jsonpath "$.ok" == true jsonpath "$.ok" == true
jsonpath "$.outcome.outcome" == "ok" jsonpath "$.outcome.outcome" == "ok"
jsonpath "$.outcome.count" == 3 jsonpath "$.outcome.count" == 5
jsonpath "$.outcome.extra.deep" == true jsonpath "$.outcome.extra.deep" == true
jsonpath "$.outcome.extra.ok" == 3 jsonpath "$.outcome.extra.ok" == 5
jsonpath "$.outcome.extra.err" == 0 jsonpath "$.outcome.extra.err" == 0
# per_check is keyed by child job name. # per_check is keyed by child job name.
jsonpath "$.outcome.extra.per_check.drives_consistency.outcome" == "ok" jsonpath "$.outcome.extra.per_check.drives_consistency.outcome" == "ok"
jsonpath "$.outcome.extra.per_check.folders_consistency.outcome" == "ok" jsonpath "$.outcome.extra.per_check.folders_consistency.outcome" == "ok"
jsonpath "$.outcome.extra.per_check.files_consistency.outcome" == "ok" jsonpath "$.outcome.extra.per_check.files_consistency.outcome" == "ok"
jsonpath "$.outcome.extra.per_check.blobs_consistency.outcome" == "ok"
jsonpath "$.outcome.extra.per_check.backend_consistency.outcome" == "ok"
# ───────────────────────────────────────────────────────────── # ─────────────────────────────────────────────────────────────
+9 -4
View File
@@ -125,10 +125,15 @@ HTTP 200
jsonpath "$.id" == "{{run_id}}" jsonpath "$.id" == "{{run_id}}"
jsonpath "$.job_name" == "drives_consistency" jsonpath "$.job_name" == "drives_consistency"
jsonpath "$.status" == "Completed" jsonpath "$.status" == "Completed"
# scanned_count is bumped by the handler's checkpoint call — at # `stats` is always present (JSONB NOT NULL DEFAULT '{}'); its
# least 0 (empty drives table) but ordinarily > 0 for any real # per-key shape is job-specific. `scanned_count` is bumped by the
# fixture data. Present-ness of the field is what we pin. # handler's `checkpoint()` call, but the drives handler only
jsonpath "$.stats.scanned_count" isNumber # checkpoints when it processes a batch — a run that finds zero
# rows in the first batch (e.g. all fixture drives sit inside the
# 1h grace window on `storage.drives.created_at`) completes
# without ever calling checkpoint, so `scanned_count` may be
# absent. Pin `stats` existence; leave the counter unpinned.
jsonpath "$.stats" exists
# ───────────────────────────────────────────────────────────── # ─────────────────────────────────────────────────────────────