refactor: rename tests on ref_count

This commit is contained in:
Edouard Vanbelle
2026-08-23 22:18:47 +02:00
parent a847e0fd2f
commit 2760fe9efc
6 changed files with 13 additions and 13 deletions
+2 -2
View File
@@ -226,7 +226,7 @@ jsonpath "$.outcome.count" exists
# JobHandler) — snapshots the registry, filters names
# ending `_consistency`, sequentially triggers each.
# `outcome.count` = number of children dispatched (6 as
# of the copy_folder_ref_count fix: drives + folders +
# of the refcount_cascade fix: drives + folders +
# files + blobs + manifests + backend). `extra.per_check`
# carries a per-child outcome
# map. Batch itself always returns ok — child failures
@@ -245,7 +245,7 @@ jsonpath "$.outcome.extra.deep" == true
jsonpath "$.outcome.extra.ok" == 6
jsonpath "$.outcome.extra.err" == 0
# per_check is keyed by child job name. `manifests_consistency` was added
# by the copy_folder_ref_count fix — see docs/plan/derived-blobs.md and
# by the refcount_cascade fix — see docs/plan/derived-blobs.md and
# `[[bug_dual_refcount_divergence]]` for why the second counter needed
# its own tenant. Auto-picked by `consistency_batch` via `.ends_with(
# "_consistency")` (no explicit list in the batch service).
@@ -12,10 +12,10 @@
#
# Covers two paths so the CDC boundary can't hide a regression:
#
# 1. Small file (`copy-ref-small.txt`) → single legacy whole-
# 1. Small file (`refcount-cascade-small.txt`) → single legacy whole-
# file blob. `storage.blobs.ref_count` counted directly on
# the file's content hash.
# 2. 2 MB file (`copy-ref-cdc.bin`) → FastCDC produces multiple
# 2. 2 MB file (`refcount-cascade-cdc.bin`) → FastCDC produces multiple
# distinct chunks. Whole-file `content_hash` still resolves
# through the dedup API.
#
@@ -42,7 +42,7 @@
#
# Run:
# hurl --variables-file tests/api/test.env --test \
# tests/api/copy_folder_ref_count.hurl
# tests/api/refcount_cascade.hurl
# =============================================================
@@ -137,7 +137,7 @@ POST {{base_url}}/api/files/upload
Authorization: Bearer {{token}}
[MultipartFormData]
folder_id: {{src_small_id}}
file: file,fixtures/copy-ref-small.txt; text/plain
file: file,fixtures/refcount-cascade-small.txt; text/plain
HTTP 201
[Captures]
@@ -378,7 +378,7 @@ POST {{base_url}}/api/files/upload
Authorization: Bearer {{token}}
[MultipartFormData]
folder_id: {{src_cdc_id}}
file: file,fixtures/copy-ref-cdc.bin; application/octet-stream
file: file,fixtures/refcount-cascade-cdc.bin; application/octet-stream
HTTP 201
[Captures]
@@ -1,8 +1,8 @@
#!/usr/bin/env bash
# =============================================================
# copy_folder_ref_count.hurl — post-failure diagnostic
# refcount_cascade.hurl — post-failure diagnostic
# =============================================================
# When `copy_folder_ref_count.hurl` asserts a specific
# When `refcount_cascade.hurl` asserts a specific
# `ref_count` value and the API returns something else, this
# script inspects the two DB tables the API surface consults
# to distinguish which side is broken:
@@ -61,7 +61,7 @@ CDC_HASH='fb1e63c28bb792e0f69cd16cd7595989f83c218cf70894e07d1f811ab1dc6f83'
log() { echo "[ref_count-diag] $*"; }
log "─────────────────────────────────────────────────────────"
log "copy_folder_ref_count.hurl failed — running diagnostic."
log "refcount_cascade.hurl failed — running diagnostic."
log "Shows blob.ref_count AND manifest.ref_count side by side —"
log "the API queries manifest first (dedup_service.rs:1543), so"
log "if the two diverge, the API surface + auditor + on-disk"
@@ -135,7 +135,7 @@ log " blob>A, manifest=A → blob increment missed"
log " blob=A, manifest<A → manifest increment missed"
log " Either column NULL → row absent from that table"
log ""
log "The API surface (`/api/dedup/check/{hash}`) queries manifest"
log "The API surface (GET /api/dedup/check/{hash}) queries manifest"
log "FIRST — that's why hurl saw manifest_stored while auditor +"
log "on-disk state ran off blob_stored."
log "─────────────────────────────────────────────────────────"
+2 -2
View File
@@ -235,8 +235,8 @@ hurl --variables-file "$API_DIR/test.env" --file-root "$REPO_ROOT/tests" --test
# the diag first, THEN exits with hurl's failure code so CI still
# reports the regression.
if ! hurl --variables-file "$API_DIR/test.env" --file-root "$REPO_ROOT/tests" --test --jobs 1 \
"$API_DIR/copy_folder_ref_count.hurl"; then
bash "$API_DIR/copy_folder_ref_count_diag.sh" || true
"$API_DIR/refcount_cascade.hurl"; then
bash "$API_DIR/refcount_cascade_diag.sh" || true
exit 1
fi