Skip to content

Commit

Permalink
test(embedded/document): ensure indexing up to date
Browse files Browse the repository at this point in the history
Signed-off-by: Jeronimo Irazabal <jeronimo.irazabal@gmail.com>
  • Loading branch information
jeroiraz committed Sep 6, 2023
1 parent de3f14c commit 8d0960b
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions embedded/document/engine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -562,8 +562,25 @@ func TestDocumentAudit(t *testing.T) {
require.NoError(t, err)

t.Run("get encoded document should return error with deleted docID", func(t *testing.T) {
_, _, _, err := engine.GetEncodedDocument(context.Background(), collectionName, docID, 0)
require.ErrorIs(t, err, ErrDocumentNotFound)
docReader, err := engine.GetDocuments(context.Background(), &protomodel.Query{
CollectionName: collectionName,
Expressions: []*protomodel.QueryExpression{
{
FieldComparisons: []*protomodel.FieldComparison{
{
Field: DefaultDocumentIDField,
Operator: protomodel.ComparisonOperator_EQ,
Value: structpb.NewStringValue(docID.EncodeToHexString()),
},
},
},
},
}, 0)
require.NoError(t, err)
defer docReader.Close()

_, err = docReader.Read(context.Background())
require.ErrorIs(t, err, ErrNoMoreDocuments)
})

res, err = engine.AuditDocument(context.Background(), collectionName, docID, false, 0, 10)
Expand Down

0 comments on commit 8d0960b

Please sign in to comment.