[4.1.2 Backport] CBG-5759: add missing pauser pattern (test-only) - #8671
Merged
Conversation
) Clean cherry pick of e1fc75a from main. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR backports the “pauser” pattern into the remaining attachment migration/compaction API tests on the 4.1.2 branch to make the tests deterministic and eliminate flakes caused by background jobs completing before assertions observe the expected intermediate states.
Changes:
- Update
TestAttachmentMigrationAPIto pause migration on a known legacy doc so a duplicate start reliably returns503 Service Unavailable. - Update
TestAttachmentMigrationMultiNodeandTestAttachmentCompactionPersistenceto pause resumed runs on node 2 and ensure there’s always an unmigrated/unmarked doc to block on. - Add additional assertions tying resumed runs to the original migration/compaction IDs.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| rest/attachmentmigrationtest/attachment_migration_api_test.go | Adds pausing to reliably keep migration “running” during duplicate-start and resume-path assertions, including multi-node resume behavior. |
| rest/attachmentcompactiontest/attachment_compaction_api_test.go | Adds pausing and ID assertions to stabilize compaction resume-path expectations. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
bbrks
approved these changes
Aug 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CBG-5759
Clean cherry pick of #8458 to 4.1.2. No conflicts; resulting diff is 2 files, +47/-7 — identical line counts to the upstream commit.
#8668 backported only the first CBG-5509 PR (#8414), which added the
migrationPauser/compactionPauserhelpers and applied them to most call sites. The follow-up #8458 applied the pauser to the two spots #8414 missed, and that half never came across, so 4.1.2 still flakes on them. Seen on #8635, wheretest (ubuntu)andtest-disable-rev-cacheboth failed on the same assertion:The migration over the 10-doc dataset finishes ~1ms before the duplicate start request lands, so nothing is running and the second POST opens a fresh run with 200 instead of rejecting with 503.
TestAttachmentMigrationAPI— addsLeakyBucketConfig, pauses atlegacyKeys[0]and waits for the block before the duplicate-start 503 check.TestAttachmentMigrationMultiNode—pauser2bound to rt2's own leaky datastore for the resumed run, plus a legacy doc created after Stopped is confirmed so the resumed run has something unmigrated to block on.TestAttachmentCompactionPersistence— same treatment for the compaction resume path.Verified with
-count=10onTestAttachmentMigrationAPI,TestAttachmentMigrationMultiNodeandTestAttachmentCompactionPersistence, plus both packages in full.test-only — both changed files are
_test.go.🤖 Generated with Claude Code