Skip to content

Commit 45b3bbf

Browse files
authored
CBG-4452 remove unhelpful test (#7666)
1 parent 6f9f245 commit 45b3bbf

File tree

2 files changed

+0
-66
lines changed

2 files changed

+0
-66
lines changed

rest/attachment_test.go

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -2390,66 +2390,6 @@ func TestPushUnknownAttachmentAsStub(t *testing.T) {
23902390
})
23912391
}
23922392

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-
24532393
func TestAttachmentWithErroneousRevPos(t *testing.T) {
24542394
rtConfig := &RestTesterConfig{
24552395
GuestEnabled: true,

rest/utilities_testing_blip_client.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -899,12 +899,6 @@ func (btcc *BlipTesterCollectionClient) updateLastReplicatedRev(docID string, ve
899899
rev.message = msg
900900
}
901901

902-
func (c *BlipTesterCollectionClient) lastSeq() clientSeq {
903-
c.seqLock.RLock()
904-
defer c.seqLock.RUnlock()
905-
return c._seqLast
906-
}
907-
908902
func newBlipTesterReplication(tb testing.TB, id string, btc *BlipTesterClient, skipCollectionsInitialization bool) *BlipTesterReplicator {
909903
bt, err := NewBlipTesterFromSpecWithRT(tb, &BlipTesterSpec{
910904
connectingPassword: RestTesterDefaultUserPassword,

0 commit comments

Comments
 (0)