diff --git a/main_test.go b/main_test.go index 30e0ae0..0dc6b55 100644 --- a/main_test.go +++ b/main_test.go @@ -5,7 +5,6 @@ import ( "sync" "time" - "github.com/stretchr/testify/require" "github.com/waku-org/go-waku/waku/v2/protocol/relay" ) @@ -21,9 +20,10 @@ var nodeList = []string{ // If using vscode, go to Preferences > Settings, and edit Go: Test Timeout to at least 60s func (s *StoreSuite) TestBasic() { - numMsgToSend := 100 pubsubTopic := relay.DefaultWakuTopic - contentTopic := "test1" + contentTopics := []string{"test1"} + startTime := time.Now() + endTime := time.Now() ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second) // Test shouldnt take more than 60s defer cancel() @@ -39,16 +39,6 @@ func (s *StoreSuite) TestBasic() { s.NotZero(len(s.node.Relay().PubSub().ListPeers(relay.DefaultWakuTopic)), "no peers available") - // Sending messages - // ================================================================ - startTime := s.node.Timesource().Now() - - // err := sendMessages( to send the msgs sequentially - err := sendMessagesConcurrent(ctx, s.node, numMsgToSend, pubsubTopic, contentTopic) - require.NoError(s.T(), err) - - endTime := s.node.Timesource().Now() - // Store // ================================================================ @@ -59,9 +49,8 @@ func (s *StoreSuite) TestBasic() { wg.Add(1) func(addr string) { defer wg.Done() - cnt, err := queryNode(ctx, s.node, addr, pubsubTopic, contentTopic, startTime, endTime) + _, err := queryNode(ctx, s.node, addr, pubsubTopic, contentTopics, startTime, endTime) s.NoError(err) - s.Equal(numMsgToSend, cnt) }(addr) } wg.Wait() diff --git a/utils_test.go b/utils_test.go index c8ad43a..cdada83 100644 --- a/utils_test.go +++ b/utils_test.go @@ -86,7 +86,7 @@ func sendMessagesConcurrent(ctx context.Context, node *node.WakuNode, numMsgToSe return nil } -func queryNode(ctx context.Context, node *node.WakuNode, addr string, pubsubTopic string, contentTopic string, startTime time.Time, endTime time.Time) (int, error) { +func queryNode(ctx context.Context, node *node.WakuNode, addr string, pubsubTopic string, contentTopics []string, startTime time.Time, endTime time.Time) (int, error) { p, err := multiaddr.NewMultiaddr(addr) if err != nil { return -1, err @@ -102,7 +102,7 @@ func queryNode(ctx context.Context, node *node.WakuNode, addr string, pubsubTopi result, err := node.Store().Query(ctx, store.Query{ Topic: pubsubTopic, - ContentTopics: []string{contentTopic}, + ContentTopics: contentTopics, StartTime: startTime.UnixNano(), EndTime: endTime.UnixNano(), }, store.WithPeer(info.ID), store.WithPaging(false, 100), store.WithRequestId([]byte{1, 2, 3, 4, 5, 6, 7, 8}))