Skip to content

Commit

Permalink
Stress tests bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
roblaszczak committed Oct 9, 2021
1 parent 4cbfb90 commit 24f7797
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pubsub/tests/test_pubsub.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func runTest(
})
}

var stressTestTestsCount = 10
var stressTestTestsCount = 5

func TestPubSubStressTest(
t *testing.T,
Expand Down Expand Up @@ -782,8 +782,8 @@ func TestConsumerGroups(

messagesToPublish := PublishSimpleMessages(t, totalMessagesCount, publisherPub, topicName)

assertConsumerGroupReceivedMessages(t, pubSubConstructor, group1, topicName, messagesToPublish)
assertConsumerGroupReceivedMessages(t, pubSubConstructor, group2, topicName, messagesToPublish)
assertConsumerGroupReceivedMessages(t, tCtx, pubSubConstructor, group1, topicName, messagesToPublish)
assertConsumerGroupReceivedMessages(t, tCtx, pubSubConstructor, group2, topicName, messagesToPublish)
}

// TestPublisherClose sends big amount of messages and them run close to ensure that messages are not lost during adding.
Expand Down Expand Up @@ -1154,6 +1154,7 @@ func restartServer(t *testing.T, features Features) {

func assertConsumerGroupReceivedMessages(
t *testing.T,
tCtx TestContext,
pubSubConstructor ConsumerGroupPubSubConstructor,
consumerGroup string,
topicName string,
Expand All @@ -1165,7 +1166,7 @@ func assertConsumerGroupReceivedMessages(
messages, err := sub.Subscribe(context.Background(), topicName)
require.NoError(t, err)

receivedMessages, all := subscriber.BulkRead(messages, len(expectedMessages), defaultTimeout)
receivedMessages, all := bulkRead(tCtx, messages, len(expectedMessages), defaultTimeout)
assert.True(t, all)

AssertAllMessagesReceived(t, expectedMessages, receivedMessages)
Expand Down

0 comments on commit 24f7797

Please # to comment.