fix: TestStressStoreQuery5kMessagesWithPagination (#70)

This commit is contained in:
Fabiana Cecin 2025-11-10 07:00:51 -03:00 committed by GitHub
commit 31fb882511
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -79,14 +79,15 @@ func TestStressStoreQuery5kMessagesWithPagination(t *testing.T) {
require.NoError(t, err, "Failed to start Waku node") require.NoError(t, err, "Failed to start Waku node")
node2.ConnectPeer(wakuNode) node2.ConnectPeer(wakuNode)
time.Sleep(200 * time.Millisecond)
defer func() { defer func() {
Debug("Stopping and destroying Waku node") Debug("Stopping and destroying Waku node")
wakuNode.StopAndDestroy() wakuNode.StopAndDestroy()
node2.StopAndDestroy() node2.StopAndDestroy()
}() }()
iterations := 2500
iterations := 1000
captureMemory(t.Name(), "at start") captureMemory(t.Name(), "at start")
@ -95,9 +96,14 @@ func TestStressStoreQuery5kMessagesWithPagination(t *testing.T) {
for i := 0; i < iterations; i++ { for i := 0; i < iterations; i++ {
message := wakuNode.CreateMessage() message := wakuNode.CreateMessage()
message.Payload = []byte(fmt.Sprintf("Test endurance message payload %d", i)) message.Payload = []byte(fmt.Sprintf("Test endurance message payload %d", i))
_, err := wakuNode.RelayPublishNoCTX(DefaultPubsubTopic, message) hash, err := wakuNode.RelayPublishNoCTX(DefaultPubsubTopic, message)
require.NoError(t, err, "Failed to publish message") require.NoError(t, err, "Failed to publish message")
err = node2.VerifyMessageReceived(message, hash)
require.NoError(t, err, "node2 failed to receive message %d", i)
err = wakuNode.VerifyMessageReceived(message, hash)
require.NoError(t, err, "wakuNode failed to receive message %d", i)
if i%10 == 0 { if i%10 == 0 {
storeQueryRequest := &common.StoreQueryRequest{ storeQueryRequest := &common.StoreQueryRequest{