Skip to content

Relax document processed assertions for SG_TEST_USE_GSI=true#7715

Merged
bbrks merged 1 commit into
mainfrom
attachment-flake
Aug 28, 2025
Merged

Relax document processed assertions for SG_TEST_USE_GSI=true#7715
bbrks merged 1 commit into
mainfrom
attachment-flake

Conversation

@torcolvin
Copy link
Copy Markdown
Collaborator

Reproducible running this test in a loop.

See:

a.docsProcessed.Add(1)
_, syncData, err := UnmarshalDocumentSyncDataFromFeed(event.Value, event.DataType, collection.userXattrKey(), false)
if err != nil {
base.WarnfCtx(ctx, "[%s] error unmarshaling document %s: %v, stopping attachment migration.", migrationLoggingID, base.UD(docID), err)
a.docsFailed.Add(1)
return false
}
if syncData == nil || syncData.AttachmentsPre4dot0 == nil {
// no attachments to migrate
return true
}

Copilot AI review requested due to automatic review settings August 28, 2025 15:44
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 modifies an attachment migration test to handle flaky behavior when using GSI test buckets. The change relaxes a strict assertion to account for potential additional documents that may be processed due to timing issues with document mutations and deletions across snapshot boundaries.

  • Updates the test assertion to be more flexible when GSI test buckets are used
  • Changes from exact equality check to minimum threshold check for documents processed

@bbrks bbrks merged commit 02429a5 into main Aug 28, 2025
25 checks passed
@bbrks bbrks deleted the attachment-flake branch August 28, 2025 16:44
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