Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
- update CBG ticket names
- remove all changes in rest package, create DocMetadata in topology
  test to include extended version information
- created log key VV for testing
  • Loading branch information
torcolvin committed Nov 15, 2024
1 parent 1b69cbc commit 959c4b8
Show file tree
Hide file tree
Showing 13 changed files with 120 additions and 127 deletions.
2 changes: 2 additions & 0 deletions base/log_keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const (
KeyReplicate
KeySync
KeySyncMsg
KeyVV
KeyWebSocket
KeyWebSocketFrame
KeySGTest
Expand Down Expand Up @@ -87,6 +88,7 @@ var (
KeyReplicate: "Replicate",
KeySync: "Sync",
KeySyncMsg: "SyncMsg",
KeyVV: "VV",
KeyWebSocket: "WS",
KeyWebSocketFrame: "WSFrame",
KeySGTest: "TEST",
Expand Down
12 changes: 6 additions & 6 deletions db/crud.go
Original file line number Diff line number Diff line change
Expand Up @@ -901,9 +901,9 @@ func (db *DatabaseCollectionWithUser) updateHLV(ctx context.Context, d *Document
hasHLV := d.HLV != nil
if d.HLV == nil {
d.HLV = &HybridLogicalVector{}
base.DebugfCtx(ctx, base.KeySGTest, "No existing HLV for doc %s", base.UD(d.ID))
base.DebugfCtx(ctx, base.KeyVV, "No existing HLV for doc %s", base.UD(d.ID))
} else {
base.DebugfCtx(ctx, base.KeySGTest, "Existing HLV for doc %s before modification %+v", base.UD(d.ID), d.HLV)
base.DebugfCtx(ctx, base.KeyVV, "Existing HLV for doc %s before modification %+v", base.UD(d.ID), d.HLV)
}
switch docUpdateEvent {
case ExistingVersion:
Expand All @@ -925,9 +925,9 @@ func (db *DatabaseCollectionWithUser) updateHLV(ctx context.Context, d *Document
return nil, err
}
d.HLV.CurrentVersionCAS = d.Cas
base.DebugfCtx(ctx, base.KeySGTest, "Adding new version to HLV due to import for doc %s, updated HLV %+v", base.UD(d.ID), d.HLV)
base.DebugfCtx(ctx, base.KeyVV, "Adding new version to HLV due to import for doc %s, updated HLV %+v", base.UD(d.ID), d.HLV)
} else {
base.DebugfCtx(ctx, base.KeySGTest, "Not updating HLV to _mou.cas == doc.cas for doc %s, extant HLV %+v", base.UD(d.ID), d.HLV)
base.DebugfCtx(ctx, base.KeyVV, "Not updating HLV to _mou.cas == doc.cas for doc %s, extant HLV %+v", base.UD(d.ID), d.HLV)
}
case NewVersion, ExistingVersionWithUpdateToHLV:
// add a new entry to the version vector
Expand Down Expand Up @@ -2098,9 +2098,9 @@ func (col *DatabaseCollectionWithUser) documentUpdateFunc(
mouMatch := false
if doc.MetadataOnlyUpdate != nil && base.HexCasToUint64(doc.MetadataOnlyUpdate.CAS) == doc.Cas {
mouMatch = base.HexCasToUint64(doc.MetadataOnlyUpdate.CAS) == doc.Cas
base.DebugfCtx(ctx, base.KeySGTest, "updateDoc(%q): _mou:%+v Metadata-only update match:%t", base.UD(doc.ID), doc.MetadataOnlyUpdate, mouMatch)
base.DebugfCtx(ctx, base.KeyVV, "updateDoc(%q): _mou:%+v Metadata-only update match:%t", base.UD(doc.ID), doc.MetadataOnlyUpdate, mouMatch)
} else {
base.DebugfCtx(ctx, base.KeySGTest, "updateDoc(%q): has no _mou", base.UD(doc.ID))
base.DebugfCtx(ctx, base.KeyVV, "updateDoc(%q): has no _mou", base.UD(doc.ID))
}
// Invoke the callback to update the document and with a new revision body to be used by the Sync Function:
newDoc, newAttachments, createNewRevIDSkipped, updatedExpiry, err := callback(doc)
Expand Down
2 changes: 1 addition & 1 deletion rest/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2834,7 +2834,7 @@ func TestPvDeltaReadAndWrite(t *testing.T) {

// assert that we have a prev CV drop to pv and a new CV pair, assert pv values are as expected after delta conversions
assert.Equal(t, testSource, newDoc.HLV.SourceID)
assert.Equal(t, version2.HLV.Version, newDoc.HLV.Version)
assert.Equal(t, version2.CV.Value, newDoc.HLV.Version)
assert.Len(t, newDoc.HLV.PreviousVersions, 1)
assert.Equal(t, casV1, newDoc.HLV.PreviousVersions[encodedSourceV1])

Expand Down
10 changes: 8 additions & 2 deletions rest/blip_api_crud_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2173,15 +2173,21 @@ func TestPullReplicationUpdateOnOtherHLVAwarePeer(t *testing.T) {
otherSource := "otherSource"
hlvHelper := db.NewHLVAgent(t, rt.GetSingleDataStore(), otherSource, "_vv")
existingHLVKey := "doc1"
_ = hlvHelper.InsertWithHLV(ctx, existingHLVKey)
cas := hlvHelper.InsertWithHLV(ctx, existingHLVKey)

// force import of this write
_, _ = rt.GetDoc(docID)
bucketDoc, _, err := collection.GetDocWithXattrs(ctx, docID, db.DocUnmarshalAll)
require.NoError(t, err)

// create doc version of the above doc write
version1 := DocVersionFromDocument(bucketDoc)
version1 := DocVersion{
RevTreeID: bucketDoc.CurrentRev,
CV: db.Version{
SourceID: hlvHelper.Source,
Value: cas,
},
}

_ = btcRunner.WaitForVersion(client.id, docID, version1)

Expand Down
31 changes: 7 additions & 24 deletions rest/utilities_testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -1485,7 +1485,7 @@ func createBlipTesterWithSpec(tb testing.TB, spec BlipTesterSpec, rt *RestTester
if err != nil {
return nil, err
}
log.Printf("db:%s Creating user: %v", bt.restTester.GetDatabase().Name, userDocBody)
log.Printf("Creating user: %v", userDocBody)

// Create a user. NOTE: this must come *after* the bt.rt.TestPublicHandler() call, otherwise it will end up getting ignored
_ = bt.restTester.SendAdminRequest(
Expand Down Expand Up @@ -2448,15 +2448,12 @@ func WaitAndAssertBackgroundManagerExpiredHeartbeat(t testing.TB, bm *db.Backgro

// DocVersion represents a specific version of a document in an revID/HLV agnostic manner.
type DocVersion struct {
RevTreeID string // RevTreeID is the rev treee ID of a document, may be empty not present
HLV *db.HybridLogicalVector // HLV is the hybrid logical vector of the document, may not be present
Mou *db.MetadataOnlyUpdate // Mou is the metadata only update of the document, may not be present
Cas uint64 // Cas is the cas value of the document
HasImplicitCV bool // If true, the HLV was constructed from cas@sourceID instead of from _vv, used for documents written to Couchbase Server without Sync Gateway
RevTreeID string
CV db.Version
}

func (v DocVersion) String() string {
return fmt.Sprintf("Cas:%d RevTreeID:%s HLV:%+v Mou:%+v HasImplicitCV:%t", v.Cas, v.RevTreeID, v.HLV, v.Mou, v.HasImplicitCV)
func (v *DocVersion) String() string {
return fmt.Sprintf("RevTreeID: %s", v.RevTreeID)
}

func (v DocVersion) Equal(o DocVersion) bool {
Expand All @@ -2468,19 +2465,15 @@ func (v DocVersion) Equal(o DocVersion) bool {

func (v DocVersion) GetRev(useHLV bool) string {
if useHLV {
if v.HLV == nil {
if v.CV.SourceID == "" {
return ""
}
return v.HLV.GetCurrentVersionString()
return v.CV.String()
} else {
return v.RevTreeID
}
}

func (v DocVersion) CV() string {
return v.GetRev(true)
}

// Digest returns the digest for the current version
func (v DocVersion) Digest() string {
return strings.Split(v.RevTreeID, "-")[1]
Expand Down Expand Up @@ -2511,16 +2504,6 @@ func NewDocVersionFromFakeRev(fakeRev string) DocVersion {
return DocVersion{RevTreeID: fakeRev}
}

// DocVersionFromDocument returns a DocVersion from the given document.
func DocVersionFromDocument(doc *db.Document) DocVersion {
return DocVersion{
RevTreeID: doc.CurrentRev,
Mou: doc.MetadataOnlyUpdate,
Cas: doc.Cas,
HLV: doc.HLV,
}
}

// DocVersionFromPutResponse returns a DocRevisionID from the given response to PUT /{, or fails the given test if a rev ID was not found.
func DocVersionFromPutResponse(t testing.TB, response *TestResponse) DocVersion {
var r struct {
Expand Down
23 changes: 15 additions & 8 deletions rest/utilities_testing_blip_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ func (btc *BlipTesterCollectionClient) PushRev(docID string, parentVersion DocVe

func (btc *BlipTesterCollectionClient) requireRevID(expected DocVersion, revID string) {
if btc.UseHLV() {
require.Equal(btc.parent.rt.TB(), expected.CV(), revID)
require.Equal(btc.parent.rt.TB(), expected.CV.String(), revID)
} else {
require.Equal(btc.parent.rt.TB(), expected.RevTreeID, revID)
}
Expand All @@ -948,7 +948,7 @@ func (btc *BlipTesterClient) GetDocVersion(docID string) DocVersion {
if !btc.UseHLV() || doc.HLV == nil {
return DocVersion{RevTreeID: doc.CurrentRev}
}
return DocVersion{RevTreeID: doc.CurrentRev, HLV: doc.HLV}
return DocVersion{RevTreeID: doc.CurrentRev, CV: db.Version{SourceID: doc.HLV.SourceID, Value: doc.HLV.Version}}
}

// PushRevWithHistory creates a revision on the client with history, and immediately sends a changes request for it.
Expand Down Expand Up @@ -1193,7 +1193,7 @@ func (btc *BlipTesterClient) AssertOnBlipHistory(t *testing.T, msg *blip.Message
require.NoError(t, err)
if subProtocol >= db.CBMobileReplicationV4 { // history could be empty a lot of the time in HLV messages as updates from the same source won't populate previous versions
if msg.Properties[db.RevMessageHistory] != "" {
assert.Equal(t, docVersion.CV(), msg.Properties[db.RevMessageHistory])
assert.Equal(t, docVersion.CV.String(), msg.Properties[db.RevMessageHistory])
}
} else {
assert.Equal(t, docVersion.RevTreeID, msg.Properties[db.RevMessageHistory])
Expand All @@ -1207,7 +1207,7 @@ func (btc *BlipTesterCollectionClient) GetVersion(docID string, docVersion DocVe

if doc, ok := btc.docs[docID]; ok {
if doc.revMode == revModeHLV {
if doc.getCurrentRevID() == docVersion.CV() {
if doc.getCurrentRevID() == docVersion.CV.String() {
return doc.body, true
}
} else {
Expand Down Expand Up @@ -1306,7 +1306,7 @@ func (btr *BlipTesterReplicator) storeMessage(msg *blip.Message) {
func (btc *BlipTesterCollectionClient) WaitForBlipRevMessage(docID string, version DocVersion) (msg *blip.Message) {
var revID string
if btc.UseHLV() {
revID = version.CV()
revID = version.CV.String()
} else {
revID = version.RevTreeID
}
Expand Down Expand Up @@ -1455,9 +1455,16 @@ func (btc *BlipTesterCollectionClient) sendPushMsg(msg *blip.Message) error {
// PutDoc will upsert the document with a given contents.
func (btc *BlipTesterClient) PutDoc(docID string, body string) DocVersion {
rt := btc.rt
var unmarshalledBody db.Body
require.NoError(rt.TB(), base.JSONUnmarshal([]byte(body), &unmarshalledBody))
return rt.PutDocDirectly(docID, unmarshalledBody)
version := rt.PutDoc(docID, body)
if btc.UseHLV() {
collection, _ := rt.GetSingleTestDatabaseCollection()
source, value := collection.GetDocumentCurrentVersion(rt.TB(), docID)
version.CV = db.Version{
SourceID: source,
Value: value,
}
}
return version
}

// RequireRev checks the current rev for the specified docID on the backend the BTC is replicating
Expand Down
16 changes: 8 additions & 8 deletions rest/utilities_testing_resttester.go
Original file line number Diff line number Diff line change
Expand Up @@ -419,35 +419,35 @@ func (rt *RestTester) RequireDbOnline() {
// TEMPORARY HELPER METHODS FOR BLIP TEST CLIENT RUNNER
func (rt *RestTester) PutDocDirectly(docID string, body db.Body) DocVersion {
collection, ctx := rt.GetSingleTestDatabaseCollectionWithUser()
_, doc, err := collection.Put(ctx, docID, body)
rev, doc, err := collection.Put(ctx, docID, body)
require.NoError(rt.TB(), err)
return DocVersionFromDocument(doc)
return DocVersion{RevTreeID: rev, CV: db.Version{SourceID: doc.HLV.SourceID, Value: doc.HLV.Version}}
}

func (rt *RestTester) UpdateDocDirectly(docID string, version DocVersion, body db.Body) DocVersion {
collection, ctx := rt.GetSingleTestDatabaseCollectionWithUser()
body[db.BodyId] = docID
body[db.BodyRev] = version.RevTreeID
_, doc, err := collection.Put(ctx, docID, body)
rev, doc, err := collection.Put(ctx, docID, body)
require.NoError(rt.TB(), err)
return DocVersionFromDocument(doc)
return DocVersion{RevTreeID: rev, CV: db.Version{SourceID: doc.HLV.SourceID, Value: doc.HLV.Version}}
}

func (rt *RestTester) DeleteDocDirectly(docID string, version DocVersion) DocVersion {
collection, ctx := rt.GetSingleTestDatabaseCollectionWithUser()
_, doc, err := collection.DeleteDoc(ctx, docID, version.RevTreeID)
rev, doc, err := collection.DeleteDoc(ctx, docID, version.RevTreeID)
require.NoError(rt.TB(), err)
return DocVersionFromDocument(doc)
return DocVersion{RevTreeID: rev, CV: db.Version{SourceID: doc.HLV.SourceID, Value: doc.HLV.Version}}
}

func (rt *RestTester) PutDocDirectlyInCollection(collection *db.DatabaseCollection, docID string, body db.Body) DocVersion {
dbUser := &db.DatabaseCollectionWithUser{
DatabaseCollection: collection,
}
ctx := base.UserLogCtx(collection.AddCollectionContext(rt.Context()), "gotest", base.UserDomainBuiltin, nil)
_, doc, err := dbUser.Put(ctx, docID, body)
rev, doc, err := dbUser.Put(ctx, docID, body)
require.NoError(rt.TB(), err)
return DocVersionFromDocument(doc)
return DocVersion{RevTreeID: rev, CV: db.Version{SourceID: doc.HLV.SourceID, Value: doc.HLV.Version}}
}

// PutDocWithAttachment will upsert the document with a given contents and attachments.
Expand Down
18 changes: 9 additions & 9 deletions topologytest/couchbase_lite_mock_peer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ func (p *CouchbaseLiteMockPeer) String() string {
}

// GetDocument returns the latest version of a document. The test will fail the document does not exist.
func (p *CouchbaseLiteMockPeer) GetDocument(_ sgbucket.DataStoreName, _ string) (rest.DocVersion, db.Body) {
func (p *CouchbaseLiteMockPeer) GetDocument(_ sgbucket.DataStoreName, _ string) (DocMetadata, db.Body) {

Check failure on line 46 in topologytest/couchbase_lite_mock_peer_test.go

View workflow job for this annotation

GitHub Actions / lint

undefined: DocMetadata

Check failure on line 46 in topologytest/couchbase_lite_mock_peer_test.go

View workflow job for this annotation

GitHub Actions / lint

undefined: DocMetadata

Check failure on line 46 in topologytest/couchbase_lite_mock_peer_test.go

View workflow job for this annotation

GitHub Actions / test (macos)

undefined: DocMetadata

Check failure on line 46 in topologytest/couchbase_lite_mock_peer_test.go

View workflow job for this annotation

GitHub Actions / test-default-collection

undefined: DocMetadata

Check failure on line 46 in topologytest/couchbase_lite_mock_peer_test.go

View workflow job for this annotation

GitHub Actions / test (macos)

undefined: DocMetadata

Check failure on line 46 in topologytest/couchbase_lite_mock_peer_test.go

View workflow job for this annotation

GitHub Actions / test-default-collection

undefined: DocMetadata

Check failure on line 46 in topologytest/couchbase_lite_mock_peer_test.go

View workflow job for this annotation

GitHub Actions / test (ubuntu)

undefined: DocMetadata

Check failure on line 46 in topologytest/couchbase_lite_mock_peer_test.go

View workflow job for this annotation

GitHub Actions / test (ubuntu)

undefined: DocMetadata

Check failure on line 46 in topologytest/couchbase_lite_mock_peer_test.go

View workflow job for this annotation

GitHub Actions / test-race

undefined: DocMetadata

Check failure on line 46 in topologytest/couchbase_lite_mock_peer_test.go

View workflow job for this annotation

GitHub Actions / test-race

undefined: DocMetadata

Check failure on line 46 in topologytest/couchbase_lite_mock_peer_test.go

View workflow job for this annotation

GitHub Actions / test (windows)

undefined: DocMetadata

Check failure on line 46 in topologytest/couchbase_lite_mock_peer_test.go

View workflow job for this annotation

GitHub Actions / test (windows)

undefined: DocMetadata
// this isn't yet collection aware, using single default collection
return rest.EmptyDocVersion(), nil
return DocMetadata{}, nil
}

// getSingleBlipClient returns the single blip client for the peer. If there are multiple clients, or not clients it will fail the test. This is temporary to stub support for multiple Sync Gateway peers.
Expand All @@ -62,28 +62,28 @@ func (p *CouchbaseLiteMockPeer) getSingleBlipClient() *PeerBlipTesterClient {
}

// CreateDocument creates a document on the peer. The test will fail if the document already exists.
func (p *CouchbaseLiteMockPeer) CreateDocument(dsName sgbucket.DataStoreName, docID string, body []byte) rest.DocVersion {
func (p *CouchbaseLiteMockPeer) CreateDocument(dsName sgbucket.DataStoreName, docID string, body []byte) DocMetadata {

Check failure on line 65 in topologytest/couchbase_lite_mock_peer_test.go

View workflow job for this annotation

GitHub Actions / lint

undefined: DocMetadata

Check failure on line 65 in topologytest/couchbase_lite_mock_peer_test.go

View workflow job for this annotation

GitHub Actions / lint

undefined: DocMetadata

Check failure on line 65 in topologytest/couchbase_lite_mock_peer_test.go

View workflow job for this annotation

GitHub Actions / test (macos)

undefined: DocMetadata

Check failure on line 65 in topologytest/couchbase_lite_mock_peer_test.go

View workflow job for this annotation

GitHub Actions / test-default-collection

undefined: DocMetadata

Check failure on line 65 in topologytest/couchbase_lite_mock_peer_test.go

View workflow job for this annotation

GitHub Actions / test (macos)

undefined: DocMetadata

Check failure on line 65 in topologytest/couchbase_lite_mock_peer_test.go

View workflow job for this annotation

GitHub Actions / test-default-collection

undefined: DocMetadata

Check failure on line 65 in topologytest/couchbase_lite_mock_peer_test.go

View workflow job for this annotation

GitHub Actions / test (ubuntu)

undefined: DocMetadata

Check failure on line 65 in topologytest/couchbase_lite_mock_peer_test.go

View workflow job for this annotation

GitHub Actions / test (ubuntu)

undefined: DocMetadata

Check failure on line 65 in topologytest/couchbase_lite_mock_peer_test.go

View workflow job for this annotation

GitHub Actions / test-race

undefined: DocMetadata

Check failure on line 65 in topologytest/couchbase_lite_mock_peer_test.go

View workflow job for this annotation

GitHub Actions / test-race

undefined: DocMetadata

Check failure on line 65 in topologytest/couchbase_lite_mock_peer_test.go

View workflow job for this annotation

GitHub Actions / test (windows)

undefined: DocMetadata

Check failure on line 65 in topologytest/couchbase_lite_mock_peer_test.go

View workflow job for this annotation

GitHub Actions / test (windows)

undefined: DocMetadata
p.t.Logf("%s: Creating document %s", p, docID)
return p.WriteDocument(dsName, docID, body)
}

// WriteDocument writes a document to the peer. The test will fail if the write does not succeed.
func (p *CouchbaseLiteMockPeer) WriteDocument(_ sgbucket.DataStoreName, docID string, body []byte) rest.DocVersion {
func (p *CouchbaseLiteMockPeer) WriteDocument(_ sgbucket.DataStoreName, docID string, body []byte) DocMetadata {

Check failure on line 71 in topologytest/couchbase_lite_mock_peer_test.go

View workflow job for this annotation

GitHub Actions / lint

undefined: DocMetadata

Check failure on line 71 in topologytest/couchbase_lite_mock_peer_test.go

View workflow job for this annotation

GitHub Actions / lint

undefined: DocMetadata

Check failure on line 71 in topologytest/couchbase_lite_mock_peer_test.go

View workflow job for this annotation

GitHub Actions / test (macos)

undefined: DocMetadata

Check failure on line 71 in topologytest/couchbase_lite_mock_peer_test.go

View workflow job for this annotation

GitHub Actions / test-default-collection

undefined: DocMetadata

Check failure on line 71 in topologytest/couchbase_lite_mock_peer_test.go

View workflow job for this annotation

GitHub Actions / test (macos)

undefined: DocMetadata

Check failure on line 71 in topologytest/couchbase_lite_mock_peer_test.go

View workflow job for this annotation

GitHub Actions / test-default-collection

undefined: DocMetadata

Check failure on line 71 in topologytest/couchbase_lite_mock_peer_test.go

View workflow job for this annotation

GitHub Actions / test (ubuntu)

undefined: DocMetadata

Check failure on line 71 in topologytest/couchbase_lite_mock_peer_test.go

View workflow job for this annotation

GitHub Actions / test (ubuntu)

undefined: DocMetadata

Check failure on line 71 in topologytest/couchbase_lite_mock_peer_test.go

View workflow job for this annotation

GitHub Actions / test-race

undefined: DocMetadata

Check failure on line 71 in topologytest/couchbase_lite_mock_peer_test.go

View workflow job for this annotation

GitHub Actions / test-race

undefined: DocMetadata

Check failure on line 71 in topologytest/couchbase_lite_mock_peer_test.go

View workflow job for this annotation

GitHub Actions / test (windows)

undefined: DocMetadata

Check failure on line 71 in topologytest/couchbase_lite_mock_peer_test.go

View workflow job for this annotation

GitHub Actions / test (windows)

undefined: DocMetadata
// this isn't yet collection aware, using single default collection
client := p.getSingleBlipClient()
// set an HLV here.
docVersion, err := client.btcRunner.PushRev(client.ID(), docID, rest.EmptyDocVersion(), body)
require.NoError(client.btcRunner.TB(), err)
return docVersion
return DocMetadataFromDocVersion(docID, docVersion)
}

// DeleteDocument deletes a document on the peer. The test will fail if the document does not exist.
func (p *CouchbaseLiteMockPeer) DeleteDocument(sgbucket.DataStoreName, string) rest.DocVersion {
return rest.EmptyDocVersion()
func (p *CouchbaseLiteMockPeer) DeleteDocument(sgbucket.DataStoreName, string) DocMetadata {

Check failure on line 81 in topologytest/couchbase_lite_mock_peer_test.go

View workflow job for this annotation

GitHub Actions / test (macos)

undefined: DocMetadata

Check failure on line 81 in topologytest/couchbase_lite_mock_peer_test.go

View workflow job for this annotation

GitHub Actions / test-default-collection

undefined: DocMetadata

Check failure on line 81 in topologytest/couchbase_lite_mock_peer_test.go

View workflow job for this annotation

GitHub Actions / test (macos)

undefined: DocMetadata

Check failure on line 81 in topologytest/couchbase_lite_mock_peer_test.go

View workflow job for this annotation

GitHub Actions / test-default-collection

undefined: DocMetadata

Check failure on line 81 in topologytest/couchbase_lite_mock_peer_test.go

View workflow job for this annotation

GitHub Actions / test (ubuntu)

undefined: DocMetadata

Check failure on line 81 in topologytest/couchbase_lite_mock_peer_test.go

View workflow job for this annotation

GitHub Actions / test (ubuntu)

undefined: DocMetadata

Check failure on line 81 in topologytest/couchbase_lite_mock_peer_test.go

View workflow job for this annotation

GitHub Actions / test-race

undefined: DocMetadata

Check failure on line 81 in topologytest/couchbase_lite_mock_peer_test.go

View workflow job for this annotation

GitHub Actions / test-race

undefined: DocMetadata

Check failure on line 81 in topologytest/couchbase_lite_mock_peer_test.go

View workflow job for this annotation

GitHub Actions / test (windows)

undefined: DocMetadata

Check failure on line 81 in topologytest/couchbase_lite_mock_peer_test.go

View workflow job for this annotation

GitHub Actions / test (windows)

undefined: DocMetadata
return DocMetadata{}
}

// WaitForDocVersion waits for a document to reach a specific version. The test will fail if the document does not reach the expected version in 20s.
func (p *CouchbaseLiteMockPeer) WaitForDocVersion(_ sgbucket.DataStoreName, docID string, _ rest.DocVersion) db.Body {
func (p *CouchbaseLiteMockPeer) WaitForDocVersion(_ sgbucket.DataStoreName, docID string, _ DocMetadata) db.Body {
// this isn't yet collection aware, using single default collection
client := p.getSingleBlipClient()
// FIXME: waiting for a specific version isn't working yet.
Expand All @@ -99,7 +99,7 @@ func (p *CouchbaseLiteMockPeer) WaitForDeletion(_ sgbucket.DataStoreName, _ stri
}

// WaitForTombstoneVersion waits for a document to reach a specific version, this must be a tombstone. The test will fail if the document does not reach the expected version in 20s.
func (p *CouchbaseLiteMockPeer) WaitForTombstoneVersion(_ sgbucket.DataStoreName, _ string, _ rest.DocVersion) {
func (p *CouchbaseLiteMockPeer) WaitForTombstoneVersion(_ sgbucket.DataStoreName, _ string, _ DocMetadata) {
require.Fail(p.TB(), "WaitForTombstoneVersion not yet implemented CBG-4257")
}

Expand Down
Loading

0 comments on commit 959c4b8

Please sign in to comment.