Skip to content

Commit be0133d

Browse files
authored
[3.2.3 backport] CBG-4523 wait for stat to avoid test flake (#7380)
1 parent 237225a commit be0133d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

rest/blip_api_attachment_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,8 @@ func TestBlipProveAttachmentV2(t *testing.T) {
223223
bodyTextExpected = fmt.Sprintf(`{"greetings":[{"howdy":"bob"}],"_attachments":{"%s":{"revpos":1,"length":%d,"stub":true,"digest":"%s"}}}`, attachmentName, len(attachmentData), attachmentDigest)
224224
require.JSONEq(t, bodyTextExpected, string(data))
225225

226-
assert.Equal(t, int64(2), btc.rt.GetDatabase().DbStats.CBLReplicationPull().RevSendCount.Value())
226+
// use RequireWaitForStat since rev is sent slightly before the stats are incremented
227+
base.RequireWaitForStat(t, btc.rt.GetDatabase().DbStats.CBLReplicationPull().RevSendCount.Value, 2)
227228
assert.Equal(t, int64(0), btc.rt.GetDatabase().DbStats.CBLReplicationPull().RevErrorCount.Value())
228229
assert.Equal(t, int64(1), btc.rt.GetDatabase().DbStats.CBLReplicationPull().AttachmentPullCount.Value())
229230
assert.Equal(t, int64(len(attachmentData)), btc.rt.GetDatabase().DbStats.CBLReplicationPull().AttachmentPullBytes.Value())

0 commit comments

Comments
 (0)