From e156ffd648038c4c5e3e39cf409490a11d5ac983 Mon Sep 17 00:00:00 2001 From: Andrew Sisley Date: Tue, 22 Oct 2024 13:49:21 -0400 Subject: [PATCH] WIP --- tests/integration/state.go | 3 +++ tests/integration/utils.go | 13 +++++++++++++ 2 files changed, 16 insertions(+) diff --git a/tests/integration/state.go b/tests/integration/state.go index 9e65458531..4948a01c54 100644 --- a/tests/integration/state.go +++ b/tests/integration/state.go @@ -175,6 +175,9 @@ type state struct { // nodes. docIDs [][]client.DocID + // CIDs by index, by field name, by doc index, by collection index. + cids [][]map[string][]cid.Cid + // Indexes, by index, by collection index, by node index. indexes [][][]client.IndexDescription diff --git a/tests/integration/utils.go b/tests/integration/utils.go index 05698e9a39..40498d98cc 100644 --- a/tests/integration/utils.go +++ b/tests/integration/utils.go @@ -24,6 +24,7 @@ import ( "time" "github.com/fxamacker/cbor/v2" + "github.com/ipfs/go-datastore/query" "github.com/sourcenetwork/corelog" "github.com/sourcenetwork/immutable" "github.com/stretchr/testify/assert" @@ -34,6 +35,7 @@ import ( "github.com/sourcenetwork/defradb/crypto" "github.com/sourcenetwork/defradb/datastore" "github.com/sourcenetwork/defradb/errors" + "github.com/sourcenetwork/defradb/internal/core" "github.com/sourcenetwork/defradb/internal/db" "github.com/sourcenetwork/defradb/internal/encryption" "github.com/sourcenetwork/defradb/internal/request/graphql" @@ -1273,6 +1275,17 @@ func createDoc( } s.docIDs[action.CollectionID] = append(s.docIDs[action.CollectionID], docIDs...) + for _, docID := range docIDs { + results, err := nodes[0].Headstore().Query( + s.ctx, + query.Query{ + Prefix: core.HeadStoreKey{ + DocID: docID.String(), + }.ToString(), + }, + ) + } + if action.ExpectedError == "" { waitForUpdateEvents(s, action.NodeID, getEventsForCreateDoc(s, action)) }