This is an automated email from the ASF dual-hosted git repository.
baodi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar-client-go.git
The following commit(s) were added to refs/heads/master by this push:
new 07f97d9 [fix] Setup rate limiter for TestChunksEnqueueFailed to
reduce flaky (#982)
07f97d9 is described below
commit 07f97d9a8c32031ab18b8f8afa82a06f7804a634
Author: Zike Yang <[email protected]>
AuthorDate: Tue Mar 7 20:06:25 2023 +0800
[fix] Setup rate limiter for TestChunksEnqueueFailed to reduce flaky (#982)
---
pulsar/message_chunking_test.go | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/pulsar/message_chunking_test.go b/pulsar/message_chunking_test.go
index aac87c7..0e1214d 100644
--- a/pulsar/message_chunking_test.go
+++ b/pulsar/message_chunking_test.go
@@ -22,6 +22,7 @@ import (
"errors"
"fmt"
"math/rand"
+ "net/http"
"strings"
"sync"
"testing"
@@ -291,6 +292,13 @@ func TestChunksEnqueueFailed(t *testing.T) {
assert.NotNil(t, producer)
defer producer.Close()
+ // Reduce publish rate to prevent the producer sending messages too fast
+ url := adminURL + "/" + "admin/v2/persistent/public/default/" + topic +
"/publishRate"
+ makeHTTPCall(t, http.MethodPost, url, "{\"publishThrottlingRateInMsg\":
1,\"publishThrottlingRateInByte\": 1000}")
+
+ // Need to wait some time to let the rate limiter take effect
+ time.Sleep(2 * time.Second)
+
ID, err := producer.Send(context.Background(), &ProducerMessage{
Payload: createTestMessagePayload(1000),
})