@@ -2390,66 +2390,6 @@ func TestPushUnknownAttachmentAsStub(t *testing.T) {
2390
2390
})
2391
2391
}
2392
2392
2393
- func TestMinRevPosWorkToAvoidUnnecessaryProveAttachment (t * testing.T ) {
2394
- rtConfig := & RestTesterConfig {
2395
- GuestEnabled : true ,
2396
- DatabaseConfig : & DatabaseConfig {
2397
- DbConfig : DbConfig {
2398
- AllowConflicts : base .Ptr (true ),
2399
- },
2400
- },
2401
- }
2402
-
2403
- btcRunner := NewBlipTesterClientRunner (t )
2404
- const docID = "doc"
2405
-
2406
- btcRunner .Run (func (t * testing.T , SupportedBLIPProtocols []string ) {
2407
- rt := NewRestTester (t , rtConfig )
2408
- defer rt .Close ()
2409
-
2410
- opts := BlipTesterClientOpts {SupportedBLIPProtocols : SupportedBLIPProtocols }
2411
- btc := btcRunner .NewBlipTesterClientOptsWithRT (rt , & opts )
2412
- defer btc .Close ()
2413
-
2414
- btcRunner .StartPull (btc .id )
2415
-
2416
- // Push an initial rev with attachment data
2417
- initialVersion := rt .PutDocWithAttachment (docID , "{}" , "hello.txt" , "aGVsbG8gd29ybGQ=" )
2418
- rt .WaitForPendingChanges ()
2419
-
2420
- // Replicate data to client and ensure doc arrives
2421
- rt .WaitForPendingChanges ()
2422
- btcRunner .WaitForVersion (btc .id , docID , initialVersion )
2423
-
2424
- // Create a set of revisions before we start the replicator to ensure there's a significant amount of history to push
2425
- version := initialVersion
2426
- for i := 0 ; i < 25 ; i ++ {
2427
- version = btcRunner .AddRev (btc .id , docID , & version , []byte (`{"update_count":` + strconv .Itoa (i )+ `,"_attachments": {"hello.txt": {"revpos":1,"stub":true,"digest":"sha1-Kq5sNclPz7QV2+lfQIuc6R7oRu0="}}}` ))
2428
- }
2429
-
2430
- // Note this references revpos 1 and therefore SGW has it - Shouldn't need proveAttachment, even when we replicate it
2431
- proveAttachmentBefore := btc .pushReplication .replicationStats .ProveAttachment .Value ()
2432
- btcRunner .StartPushWithOpts (btc .id , BlipTesterPushOptions {Continuous : false })
2433
- rt .WaitForVersion (docID , version )
2434
-
2435
- proveAttachmentAfter := btc .pushReplication .replicationStats .ProveAttachment .Value ()
2436
- assert .Equal (t , proveAttachmentBefore , proveAttachmentAfter )
2437
-
2438
- // start another push to run in the background from where we last left off
2439
- latestSeq := btcRunner .SingleCollection (btc .id ).lastSeq ()
2440
- btcRunner .StartPushWithOpts (btc .id , BlipTesterPushOptions {Continuous : true , Since : strconv .Itoa (int (latestSeq ))})
2441
-
2442
- // Push another bunch of history, this time whilst a replicator is actively pushing them
2443
- for i := 25 ; i < 50 ; i ++ {
2444
- version = btcRunner .AddRev (btc .id , docID , & version , []byte (`{"update_count":` + strconv .Itoa (i )+ `,"_attachments": {"hello.txt": {"revpos":1,"stub":true,"digest":"sha1-Kq5sNclPz7QV2+lfQIuc6R7oRu0="}}}` ))
2445
- }
2446
-
2447
- rt .WaitForVersion (docID , version )
2448
- proveAttachmentAfter = btc .pushReplication .replicationStats .ProveAttachment .Value ()
2449
- assert .Equal (t , proveAttachmentBefore , proveAttachmentAfter )
2450
- })
2451
- }
2452
-
2453
2393
func TestAttachmentWithErroneousRevPos (t * testing.T ) {
2454
2394
rtConfig := & RestTesterConfig {
2455
2395
GuestEnabled : true ,
0 commit comments