From 992abd3e1c9b8818df519450cc5d2d2e9da056b7 Mon Sep 17 00:00:00 2001 From: Ben Brooks Date: Wed, 5 Aug 2026 21:56:41 +0100 Subject: [PATCH] [4.1.2 Backport] CBG-5547: fix assertion and log tagging in WaitForPullNoRevMessage Cherry-picked from 1646aec9053e126005279f50be68a76d7310e73d (CBG-5547, #8552). Co-authored-by: Ben Brooks Co-authored-by: Claude Opus 5 (1M context) --- rest/utilities_testing_blip_client.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/rest/utilities_testing_blip_client.go b/rest/utilities_testing_blip_client.go index d424d01390..177d52c953 100644 --- a/rest/utilities_testing_blip_client.go +++ b/rest/utilities_testing_blip_client.go @@ -2077,10 +2077,9 @@ func (btcc *BlipTesterCollectionClient) WaitForPullNoRevMessage(docID string, ve matches = append(matches, m) } } - if !assert.NotEmpty(c, matches, "norev message not found for docID %q version %v in pull replication messages", docID, version) { + if !assert.Len(c, matches, 1, "expected exactly one norev message for docID %q version %v in pull replication messages, got %d", docID, version, len(matches)) { return } - require.Len(btcc.TB(), matches, 1, "expected exactly one norev message for docID %q version %v, got %d", docID, version, len(matches)) msg = matches[0] }, 10*time.Second, 5*time.Millisecond, "BlipTesterClient timed out waiting for pull norev message") return msg @@ -2303,7 +2302,7 @@ func (btcc *BlipTesterCollectionClient) addRev(ctx context.Context, docID string // the raw pull replication message log directly. if opts.isNoRev && newBody == nil && hasLocalDoc && doc._latestRev(btcc.TB()).body != nil { require.Equal(btcc.TB(), db.MessageNoRev, opts.msg.Profile(), "only norev messages should hit this bodyless-clobber guard") - base.DebugfCtx(ctx, base.KeySGTest, "Ignoring norev body for docID %q: no body for version %#v", docID, opts.incomingVersion) + base.DebugfCtx(ctx, base.KeySGTest, "Ignoring norev body for docID %s: no body for version %#v", base.UD(docID), opts.incomingVersion) return } newVersion.CV = *updatedHLV.ExtractCurrentVersionFromHLV()