test(artist-dir): fix flaky uq_image_record_sha256 collision #115

Merged
bvandeusen merged 1 commits from dev into main 2026-06-16 20:34:21 -04:00
Owner

test_artist_directory_service._seed_image built sha256 from abs(hash(suffix)) % 10000 — PYTHONHASHSEED-randomized hash() over only 10k buckets, so two suffixes in one test could birthday-collide and violate uq_image_record_sha256. Flaky per process seed: passed on dev (run 1179), failed integration on main (run 1182) with identical code. Now uses hashlib.sha256(suffix).hexdigest().

This greens up main after #114 (whose ml-worker image already built fine — only the integration lane flaked).

CI green on dev (run 1184, 002279e).

🤖 Generated with Claude Code

`test_artist_directory_service._seed_image` built sha256 from `abs(hash(suffix)) % 10000` — PYTHONHASHSEED-randomized hash() over only 10k buckets, so two suffixes in one test could birthday-collide and violate `uq_image_record_sha256`. Flaky per process seed: passed on dev (run 1179), failed integration on main (run 1182) with identical code. Now uses `hashlib.sha256(suffix).hexdigest()`. This greens up main after #114 (whose ml-worker image already built fine — only the integration lane flaked). CI green on dev (run 1184, 002279e). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
bvandeusen added 1 commit 2026-06-16 20:34:17 -04:00
test(artist-dir): deterministic sha256 in _seed_image (fix flaky uq collision)
CI / lint (push) Successful in 2s
CI / frontend-build (push) Successful in 22s
CI / backend-lint-and-test (push) Successful in 31s
CI / integration (push) Successful in 3m18s
002279e63b
test_artist_directory_service._seed_image built sha256 from
abs(hash(suffix)) % 10000 — PYTHONHASHSEED-randomized hash() over only 10k
buckets, so two suffixes in one test could birthday-collide and violate
uq_image_record_sha256. Flaky per process seed: passed on dev (run 1179),
failed on main (run 1182) with identical code. Use
hashlib.sha256(suffix).hexdigest() for a stable, collision-free digest.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
bvandeusen merged commit 2e806f202f into main 2026-06-16 20:34:21 -04:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bvandeusen/FabledCurator#115