This is an automated email from the ASF dual-hosted git repository.

zike 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 8ea5300d fix(test): add localhost advertised address to standalone 
startup (#1480)
8ea5300d is described below

commit 8ea5300dc3d3cd3c16863c888af982054541bf8a
Author: Zike Yang <[email protected]>
AuthorDate: Wed Apr 15 18:04:28 2026 +0800

    fix(test): add localhost advertised address to standalone startup (#1480)
    
    
    
    ### Motivation
    
    https://github.com/apache/pulsar/pull/25238 introduced a breaking change 
for standalone startup.
    
    This PR ensures every `pulsar standalone` startup path uses 
`--advertised-address localhost`.
    
    
    ### Modifications
    
    - update testcontainers-based standalone startup commands in producer tests
    - update testcontainers-based standalone startup commands in consumer tests
    - keep the test service start script using
      `--advertised-address localhost` for docker and in-container startup
---
 integration-tests/tokens/token.txt | 2 +-
 pulsar/consumer_test.go            | 2 +-
 pulsar/consumer_zero_queue_test.go | 4 ++--
 pulsar/producer_test.go            | 4 ++--
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/integration-tests/tokens/token.txt 
b/integration-tests/tokens/token.txt
index b1b8309c..afdce216 100644
--- a/integration-tests/tokens/token.txt
+++ b/integration-tests/tokens/token.txt
@@ -1 +1 @@
-eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0b2tlbi1wcmluY2lwYWwifQ.tSfgR8l7dKC6LoWCxQgNkuSB8our7xV_nAM7wpgCbG4
+eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0b2tlbi1wcmluY2lwYWwifQ.tSfgR8l7dKC6LoWCxQgNkuSB8our7xV_nAM7wpgCbG4
\ No newline at end of file
diff --git a/pulsar/consumer_test.go b/pulsar/consumer_test.go
index 9f20ed84..0d710ead 100644
--- a/pulsar/consumer_test.go
+++ b/pulsar/consumer_test.go
@@ -5598,7 +5598,7 @@ func TestConsumerKeepReconnectingAndThenCallClose(t 
*testing.T) {
                Image:        getPulsarTestImage(),
                ExposedPorts: []string{"6650/tcp", "8080/tcp"},
                WaitingFor:   wait.ForExposedPort(),
-               Cmd:          []string{"bin/pulsar", "standalone", "-nfw"},
+               Cmd:          []string{"bin/pulsar", "standalone", "-nfw", 
"--advertised-address", "localhost"},
        }
        c, err := testcontainers.GenericContainer(context.Background(), 
testcontainers.GenericContainerRequest{
                ContainerRequest: req,
diff --git a/pulsar/consumer_zero_queue_test.go 
b/pulsar/consumer_zero_queue_test.go
index 0b3e8760..ccf4e18f 100644
--- a/pulsar/consumer_zero_queue_test.go
+++ b/pulsar/consumer_zero_queue_test.go
@@ -138,7 +138,7 @@ func TestReconnectConsumer(t *testing.T) {
                                "8080/tcp": {{HostIP: "0.0.0.0", HostPort: 
"8089"}},
                        }
                },
-               Cmd: []string{"bin/pulsar", "standalone", "-nfw"},
+               Cmd: []string{"bin/pulsar", "standalone", "-nfw", 
"--advertised-address", "localhost"},
        }
        c, err := testcontainers.GenericContainer(context.Background(), 
testcontainers.GenericContainerRequest{
                ContainerRequest: req,
@@ -255,7 +255,7 @@ func TestReconnectedBrokerSendPermits(t *testing.T) {
                                "8080/tcp": {{HostIP: "0.0.0.0", HostPort: 
"8089"}},
                        }
                },
-               Cmd: []string{"bin/pulsar", "standalone", "-nfw"},
+               Cmd: []string{"bin/pulsar", "standalone", "-nfw", 
"--advertised-address", "localhost"},
        }
        c, err := testcontainers.GenericContainer(context.Background(), 
testcontainers.GenericContainerRequest{
                ContainerRequest: req,
diff --git a/pulsar/producer_test.go b/pulsar/producer_test.go
index 529511a0..357aa690 100644
--- a/pulsar/producer_test.go
+++ b/pulsar/producer_test.go
@@ -2671,7 +2671,7 @@ func TestProducerKeepReconnectingAndThenCallClose(t 
*testing.T) {
                Image:        getPulsarTestImage(),
                ExposedPorts: []string{"6650/tcp", "8080/tcp"},
                WaitingFor:   wait.ForExposedPort(),
-               Cmd:          []string{"bin/pulsar", "standalone", "-nfw"},
+               Cmd:          []string{"bin/pulsar", "standalone", "-nfw", 
"--advertised-address", "localhost"},
        }
        c, err := testcontainers.GenericContainer(context.Background(), 
testcontainers.GenericContainerRequest{
                ContainerRequest: req,
@@ -2806,7 +2806,7 @@ func testSendAsyncCouldTimeoutWhileReconnecting(t 
*testing.T, isDisableBatching
                Image:        getPulsarTestImage(),
                ExposedPorts: []string{"6650/tcp", "8080/tcp"},
                WaitingFor:   wait.ForExposedPort(),
-               Cmd:          []string{"bin/pulsar", "standalone", "-nfw"},
+               Cmd:          []string{"bin/pulsar", "standalone", "-nfw", 
"--advertised-address", "localhost"},
        }
        c, err := testcontainers.GenericContainer(context.Background(), 
testcontainers.GenericContainerRequest{
                ContainerRequest: req,

Reply via email to