Skip to content

test: stop the live crosspost and gallery tests from flaking - #94

Open
Toldry wants to merge 1 commit into
masterfrom
claude/fix-flaky-live-tests
Open

Toldry wants to merge 1 commit into
masterfrom
claude/fix-flaky-live-tests

Conversation

@Toldry

@Toldry Toldry commented Oct 16, 2026

Copy link
Copy Markdown
Owner

Requested by Querent · project thread

Before: the live integration tests failed on the #91 merge (run 38912321800), blocking the deploy of v3.0.0. test_live_duplicate_detector_reads_crossposts_through_the_original[gallery] died on an HTTP 403, and test_live_duplicate_detector_scans_gallery_posts found no duplicate in r/racb_test_1.

After: the crosspost test reads only the fields Reddit sent with the r/all listing, and the gallery test waits longer for Reddit's "new" listing to show the post it just made.

How: find_crosspost used getattr(post, 'crosspost_parent_list', None). Most listed posts lack that field, so PRAW downloaded each of them (the same problem v2.14.4 fixed in the scan itself), and one of those downloads hit a post the bot may not read (/comments/1x7h2vd/ → 403). It now uses duplicate_detector.post_attribute. The gallery test polled 3 times 2 s apart; it now polls 10 times 3 s apart. Neither duplicate_detector.py nor these tests changed between the passing run on b4d9e81 and the failing one, so these are flaky tests, not a regression from #91.

The integration tests only run on pushes to master, so this PR's CI runs the unit tests only (1725 passed locally).

🤖 Generated with Claude Code

https://claude.ai/code/session_01GouCjc4iTJtifPTNp2j19g


Generated by Claude Code

find_crosspost used getattr on r/all listing posts, so PRAW downloaded
every post that was not a crosspost; one answered HTTP 403 and failed
the run. Read the field with post_attribute, as the scan does since
v2.14.4. The gallery scan test also polls up to 30 s for Reddit's "new"
listing to show the post it just made.

Co-Authored-By: Toldry <toldry@gmail.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GouCjc4iTJtifPTNp2j19g
@Toldry Toldry self-assigned this Oct 16, 2026
@Toldry
Toldry marked this pull request as ready for review October 16, 2026 14:42

This branch has not been deployed

No deployments
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.

2 participants