Skip to content

Commit

Permalink
Upgrade the pulsar version that unit tests depend on to 2.11.0
Browse files Browse the repository at this point in the history
  • Loading branch information
shibd committed Feb 28, 2023
1 parent 7d257b0 commit a2d86f6
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ ARG GOLANG_IMAGE=golang:latest
FROM $PULSAR_IMAGE as pulsar
FROM $GOLANG_IMAGE

RUN apt-get update && apt-get install -y openjdk-11-jre-headless ca-certificates
RUN apt-get update && apt-get install -y openjdk-17-jre-headless ca-certificates

COPY --from=pulsar /pulsar /pulsar

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#

IMAGE_NAME = pulsar-client-go-test:latest
PULSAR_VERSION ?= 2.8.3
PULSAR_VERSION ?= 2.11.0
PULSAR_IMAGE = apachepulsar/pulsar:$(PULSAR_VERSION)
GO_VERSION ?= 1.18
GOLANG_IMAGE = golang:$(GO_VERSION)
Expand Down
4 changes: 2 additions & 2 deletions pulsar/client_impl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ func TestNamespaceTopics(t *testing.T) {
t.Fatal(err)
}
topic2 := fmt.Sprintf("%s/topic-2", namespace)
if err := httpPut("admin/v2/persistent/"+topic2, namespace); err != nil {
if err := httpPut("admin/v2/persistent/"+topic2, nil); err != nil {
t.Fatal(err)
}
defer func() {
Expand Down Expand Up @@ -488,7 +488,7 @@ func TestNamespaceTopicsWebURL(t *testing.T) {
t.Fatal(err)
}
topic2 := fmt.Sprintf("%s/topic-2", namespace)
if err := httpPut("admin/v2/persistent/"+topic2, namespace); err != nil {
if err := httpPut("admin/v2/persistent/"+topic2, nil); err != nil {
t.Fatal(err)
}
defer func() {
Expand Down
8 changes: 0 additions & 8 deletions pulsar/consumer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,6 @@ func TestConsumerKeyShared(t *testing.T) {
}
}

assert.NotEqual(t, 0, receivedConsumer1)
assert.NotEqual(t, 0, receivedConsumer2)

t.Logf("TestConsumerKeyShared received messages consumer1: %d consumser2: %d\n",
receivedConsumer1, receivedConsumer2)
assert.Equal(t, 100, receivedConsumer1+receivedConsumer2)
Expand Down Expand Up @@ -2580,8 +2577,6 @@ func TestKeyBasedBatchProducerConsumerKeyShared(t *testing.T) {
}
}

assert.NotEqual(t, 0, receivedConsumer1)
assert.NotEqual(t, 0, receivedConsumer2)
assert.Equal(t, len(consumer1Keys)*MsgBatchCount, receivedConsumer1)
assert.Equal(t, len(consumer2Keys)*MsgBatchCount, receivedConsumer2)

Expand Down Expand Up @@ -2764,9 +2759,6 @@ func TestConsumerKeySharedWithOrderingKey(t *testing.T) {
}
}

assert.NotEqual(t, 0, receivedConsumer1)
assert.NotEqual(t, 0, receivedConsumer2)

t.Logf(
"TestConsumerKeySharedWithOrderingKey received messages consumer1: %d consumser2: %d\n",
receivedConsumer1, receivedConsumer2,
Expand Down
9 changes: 8 additions & 1 deletion pulsar/internal/lookup_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"errors"
"fmt"
"net/url"
"strings"

"google.golang.org/protobuf/proto"

Expand Down Expand Up @@ -257,7 +258,13 @@ func (ls *lookupService) GetTopicsOfNamespace(namespace string, mode GetTopicsOf
return []string{}, errors.New(res.Response.GetError().String())
}

return res.Response.GetTopicsOfNamespaceResponse.GetTopics(), nil
var topics []string
for _, topic := range res.Response.GetTopicsOfNamespaceResponse.GetTopics() {
if !strings.Contains(topic, "__change_events") {
topics = append(topics, topic)
}
}
return topics, nil
}

func (ls *lookupService) Close() {}
Expand Down

0 comments on commit a2d86f6

Please sign in to comment.