Skip to content

[4.1.2 Backport] CBG-5759: add missing pauser pattern (test-only) - #8671

Merged
torcolvin merged 1 commit into
release/4.1.2from
CBG-5759
Aug 26, 2026
Merged

[4.1.2 Backport] CBG-5759: add missing pauser pattern (test-only)#8671
torcolvin merged 1 commit into
release/4.1.2from
CBG-5759

Conversation

@torcolvin

Copy link
Copy Markdown
Collaborator

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/compactionPauser helpers 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, where test (ubuntu) and test-disable-rev-cache both failed on the same assertion:

    attachment_migration_api_test.go:62:
        	Error:      	Not equal:
        	            	expected: 503
        	            	actual  : 200
        	Test:       	TestAttachmentMigrationAPI
        	Messages:   	Response status 200 "OK" (expected 503 "Service Unavailable")

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 — adds LeakyBucketConfig, pauses at legacyKeys[0] and waits for the block before the duplicate-start 503 check.
  • TestAttachmentMigrationMultiNodepauser2 bound 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=10 on TestAttachmentMigrationAPI, TestAttachmentMigrationMultiNode and TestAttachmentCompactionPersistence, plus both packages in full.

test-only — both changed files are _test.go.

🤖 Generated with Claude Code

)

Clean cherry pick of e1fc75a from main.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@torcolvin
torcolvin requested review from a team and a lite review from Copilot August 26, 2026 13:33
@torcolvin
torcolvin requested a review from bbrks August 26, 2026 13:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 TestAttachmentMigrationAPI to pause migration on a known legacy doc so a duplicate start reliably returns 503 Service Unavailable.
  • Update TestAttachmentMigrationMultiNode and TestAttachmentCompactionPersistence to 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.

Comment thread rest/attachmentcompactiontest/attachment_compaction_api_test.go
Comment thread rest/attachmentmigrationtest/attachment_migration_api_test.go
@torcolvin
torcolvin merged commit 012c33b into release/4.1.2 Aug 26, 2026
43 checks passed
@torcolvin
torcolvin deleted the CBG-5759 branch August 26, 2026 13:47
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.

3 participants