From 93d0414c58635e540a41e9c783e16ed347cef5bc Mon Sep 17 00:00:00 2001 From: streamnativebot Date: Fri, 1 May 2026 01:41:03 +0000 Subject: [PATCH 01/19] "Created by snbot" --- scripts/run-integration-tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/run-integration-tests.sh b/scripts/run-integration-tests.sh index 9d60043e..e0c5a3c7 100755 --- a/scripts/run-integration-tests.sh +++ b/scripts/run-integration-tests.sh @@ -3,7 +3,7 @@ set -e readonly PROJECT_ROOT=`cd $(dirname $0)/..; pwd` readonly IMAGE_NAME=pulsarctl-test -readonly PULSAR_DEFAULT_VERSION="4.1.3" +readonly PULSAR_DEFAULT_VERSION="4.3.0-SNAPSHOT" readonly PULSAR_VERSION=${PULSAR_VERSION:-${PULSAR_DEFAULT_VERSION}} readonly PULSAR_IMAGE=${PULSAR_IMAGE:-"apachepulsar/pulsar-all"} From 394981d6377427777333bfd5be0f8e316fe4fca4 Mon Sep 17 00:00:00 2001 From: Jiwei Guo Date: Fri, 1 May 2026 09:50:04 +0800 Subject: [PATCH 02/19] fix test --- scripts/entrypoint.sh | 2 +- test/script/check.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index 629f4ebb..32d91be5 100755 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -7,7 +7,7 @@ readonly TEST_ARGS=${TEST_ARGS:-""} function checkFunctionWorker() { failed=0 - until curl --silent localhost:8080/admin/v2/persistent/public/functions/coordinate/stats; do + until curl --fail --silent --show-error localhost:8080/admin/v2/persistent/public/functions/coordinate/stats >/dev/null; do echo "waiting function worker service start..." failed=`expr ${failed} + 1` if [[ ${failed} == 30 ]]; then diff --git a/test/script/check.sh b/test/script/check.sh index 5ad888b1..a4a5794b 100755 --- a/test/script/check.sh +++ b/test/script/check.sh @@ -18,7 +18,7 @@ function checkBookieHTTP() { function checkFunctionWorker() { failed=0 - until curl localhost:8080/admin/v2/persistent/public/functions/coordinate/stats; do + until curl --fail --silent --show-error localhost:8080/admin/v2/persistent/public/functions/coordinate/stats >/dev/null; do echo "waiting function worker service start..." failed=`expr ${failed} + 1` if [[ ${failed} == 30 ]]; then @@ -37,4 +37,4 @@ case $1 in *) echo Which service you would like to check? echo Available service: bookieHTTP, functionWorker ;; -esac \ No newline at end of file +esac From 49bc52d13f80d825b5029c0db4da13a30eb87609 Mon Sep 17 00:00:00 2001 From: Jiwei Guo Date: Fri, 1 May 2026 09:57:05 +0800 Subject: [PATCH 03/19] fix test --- .github/workflows/ci-auth-checks.yml | 4 ++-- .github/workflows/ci-checks.yml | 2 +- .github/workflows/ci-functions-checks.yml | 6 +++--- .github/workflows/ci-packages-checks.yml | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-auth-checks.yml b/.github/workflows/ci-auth-checks.yml index 7c5b7a50..b25f455e 100644 --- a/.github/workflows/ci-auth-checks.yml +++ b/.github/workflows/ci-auth-checks.yml @@ -18,8 +18,8 @@ jobs: - name: Run token tests run: scripts/run-integration-tests.sh token env: - PULSAR_IMAGE: ${{ github.actor == 'streamnativebot' && 'snstage/pulsar-all' || 'apachepulsar/pulsar-all' }} + PULSAR_IMAGE: snstage/pulsar-all - name: Run TLS tests run: scripts/run-integration-tests.sh tls env: - PULSAR_IMAGE: ${{ github.actor == 'streamnativebot' && 'snstage/pulsar-all' || 'apachepulsar/pulsar-all' }} + PULSAR_IMAGE: snstage/pulsar-all diff --git a/.github/workflows/ci-checks.yml b/.github/workflows/ci-checks.yml index fca8ca51..240b2aeb 100644 --- a/.github/workflows/ci-checks.yml +++ b/.github/workflows/ci-checks.yml @@ -18,4 +18,4 @@ jobs: - name: Run tests run: scripts/run-integration-tests.sh env: - PULSAR_IMAGE: ${{ github.actor == 'streamnativebot' && 'snstage/pulsar-all' || 'apachepulsar/pulsar-all' }} + PULSAR_IMAGE: snstage/pulsar-all diff --git a/.github/workflows/ci-functions-checks.yml b/.github/workflows/ci-functions-checks.yml index c3333b00..3a13ed3e 100644 --- a/.github/workflows/ci-functions-checks.yml +++ b/.github/workflows/ci-functions-checks.yml @@ -24,7 +24,7 @@ jobs: - name: Function tests run: scripts/run-integration-tests.sh function env: - PULSAR_IMAGE: ${{ github.actor == 'streamnativebot' && 'snstage/pulsar-all' || 'apachepulsar/pulsar-all' }} + PULSAR_IMAGE: snstage/pulsar-all - name: Setup tmate session if: failure() uses: mxschmitt/action-tmate@v3 @@ -44,7 +44,7 @@ jobs: - name: Sink tests run: scripts/run-integration-tests.sh sink env: - PULSAR_IMAGE: ${{ github.actor == 'streamnativebot' && 'snstage/pulsar-all' || 'apachepulsar/pulsar-all' }} + PULSAR_IMAGE: snstage/pulsar-all source-tests: runs-on: ubuntu-latest steps: @@ -61,4 +61,4 @@ jobs: - name: Source tests run: scripts/run-integration-tests.sh source env: - PULSAR_IMAGE: ${{ github.actor == 'streamnativebot' && 'snstage/pulsar-all' || 'apachepulsar/pulsar-all' }} + PULSAR_IMAGE: snstage/pulsar-all diff --git a/.github/workflows/ci-packages-checks.yml b/.github/workflows/ci-packages-checks.yml index c2b69b9c..497d9d56 100644 --- a/.github/workflows/ci-packages-checks.yml +++ b/.github/workflows/ci-packages-checks.yml @@ -24,7 +24,7 @@ jobs: - name: Packages tests run: scripts/run-integration-tests.sh packages env: - PULSAR_IMAGE: ${{ github.actor == 'streamnativebot' && 'snstage/pulsar-all' || 'apachepulsar/pulsar-all' }} + PULSAR_IMAGE: snstage/pulsar-all - name: Setup tmate session if: failure() uses: mxschmitt/action-tmate@v3 From d1f982587000cefc3f523263dcde8d4174ff61a8 Mon Sep 17 00:00:00 2001 From: Jiwei Guo Date: Fri, 1 May 2026 10:01:12 +0800 Subject: [PATCH 04/19] fix test --- .github/workflows/ci-auth-checks.yml | 1 - .github/workflows/ci-checks.yml | 1 - .github/workflows/ci-functions-checks.yml | 3 --- .github/workflows/ci-install-script-checks.yml | 1 - .github/workflows/ci-packages-checks.yml | 1 - 5 files changed, 7 deletions(-) diff --git a/.github/workflows/ci-auth-checks.yml b/.github/workflows/ci-auth-checks.yml index b25f455e..0541a462 100644 --- a/.github/workflows/ci-auth-checks.yml +++ b/.github/workflows/ci-auth-checks.yml @@ -13,7 +13,6 @@ jobs: steps: - uses: actions/checkout@v2 - name: Login SN docker hub - if: github.actor == 'streamnativebot' run: docker login -u="${{ secrets.DOCKER_USER }}" -p="${{ secrets.DOCKER_PASSWORD}}" - name: Run token tests run: scripts/run-integration-tests.sh token diff --git a/.github/workflows/ci-checks.yml b/.github/workflows/ci-checks.yml index 240b2aeb..c10318f2 100644 --- a/.github/workflows/ci-checks.yml +++ b/.github/workflows/ci-checks.yml @@ -12,7 +12,6 @@ jobs: runs-on: ubuntu-latest steps: - name: Login SN docker hub - if: github.actor == 'streamnativebot' run: docker login -u="${{ secrets.DOCKER_USER }}" -p="${{ secrets.DOCKER_PASSWORD}}" - uses: actions/checkout@v2 - name: Run tests diff --git a/.github/workflows/ci-functions-checks.yml b/.github/workflows/ci-functions-checks.yml index 3a13ed3e..d4199c01 100644 --- a/.github/workflows/ci-functions-checks.yml +++ b/.github/workflows/ci-functions-checks.yml @@ -12,7 +12,6 @@ jobs: runs-on: ubuntu-latest steps: - name: Login SN docker hub - if: github.actor == 'streamnativebot' run: docker login -u="${{ secrets.DOCKER_USER }}" -p="${{ secrets.DOCKER_PASSWORD}}" - name: Set up Go 1.25.9 uses: actions/setup-go@v6 @@ -32,7 +31,6 @@ jobs: runs-on: ubuntu-latest steps: - name: Login SN docker hub - if: github.actor == 'streamnativebot' run: docker login -u="${{ secrets.DOCKER_USER }}" -p="${{ secrets.DOCKER_PASSWORD}}" - name: Set up Go 1.25.9 uses: actions/setup-go@v6 @@ -49,7 +47,6 @@ jobs: runs-on: ubuntu-latest steps: - name: Login SN docker hub - if: github.actor == 'streamnativebot' run: docker login -u="${{ secrets.DOCKER_USER }}" -p="${{ secrets.DOCKER_PASSWORD}}" - name: Set up Go 1.25.9 uses: actions/setup-go@v6 diff --git a/.github/workflows/ci-install-script-checks.yml b/.github/workflows/ci-install-script-checks.yml index 3bba5276..aba93c6a 100644 --- a/.github/workflows/ci-install-script-checks.yml +++ b/.github/workflows/ci-install-script-checks.yml @@ -11,7 +11,6 @@ jobs: runs-on: ubuntu-latest steps: - name: Login SN docker hub - if: github.actor == 'streamnativebot' run: docker login -u="${{ secrets.DOCKER_USER }}" -p="${{ secrets.DOCKER_PASSWORD}}" - name: Check out code into the Go module directory uses: actions/checkout@v2 diff --git a/.github/workflows/ci-packages-checks.yml b/.github/workflows/ci-packages-checks.yml index 497d9d56..3b7277d5 100644 --- a/.github/workflows/ci-packages-checks.yml +++ b/.github/workflows/ci-packages-checks.yml @@ -12,7 +12,6 @@ jobs: runs-on: ubuntu-latest steps: - name: Login SN docker hub - if: github.actor == 'streamnativebot' run: docker login -u="${{ secrets.DOCKER_USER }}" -p="${{ secrets.DOCKER_PASSWORD}}" - name: Set up Go 1.25.9 uses: actions/setup-go@v5 From b61b12fefb2e2c520c93b334fe9df66517575a56 Mon Sep 17 00:00:00 2001 From: Jiwei Guo Date: Fri, 1 May 2026 10:12:17 +0800 Subject: [PATCH 05/19] create topic --- pkg/ctl/sinks/opeations_test.go | 10 ++++++++-- pkg/ctl/sources/operations_test.go | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/pkg/ctl/sinks/opeations_test.go b/pkg/ctl/sinks/opeations_test.go index 256716ea..09f93dea 100644 --- a/pkg/ctl/sinks/opeations_test.go +++ b/pkg/ctl/sinks/opeations_test.go @@ -28,13 +28,16 @@ import ( "github.com/stretchr/testify/assert" "github.com/streamnative/pulsarctl/pkg/cmdutils" + "github.com/streamnative/pulsarctl/pkg/ctl/topic" "github.com/streamnative/pulsarctl/pkg/test" ) // This tests will test all sink operations func TestSinksOperations(t *testing.T) { narFile := path.Join(resourceDir(), "data-generator.nar") - sinkName := "test-sink-opt" + test.RandomSuffix() + suffix := test.RandomSuffix() + sinkName := "test-sink-opt" + suffix + inputTopic := "persistent://public/default/sink-input-" + suffix defaultArgs := []string{ "--tenant", "public", @@ -42,6 +45,9 @@ func TestSinksOperations(t *testing.T) { "--name", sinkName, } + _, execErr, _, err := topic.TestTopicCommands(topic.CreateTopicCmd, []string{inputTopic, "0"}) + failImmediatelyIfErrorNotNil(t, execErr, err) + listArgs := []string{"list"} out, execErr, err := TestSinksCommands(listSinksCmd, listArgs) failImmediatelyIfErrorNotNil(t, execErr, err) @@ -49,7 +55,7 @@ func TestSinksOperations(t *testing.T) { createArgs := []string{ "create", - "--inputs", "sink-input", + "--inputs", inputTopic, "--archive", narFile, } out, execErr, err = TestSinksCommands(createSinksCmd, append(createArgs, defaultArgs...)) diff --git a/pkg/ctl/sources/operations_test.go b/pkg/ctl/sources/operations_test.go index af15950a..a8b8cdb6 100644 --- a/pkg/ctl/sources/operations_test.go +++ b/pkg/ctl/sources/operations_test.go @@ -28,13 +28,16 @@ import ( "github.com/stretchr/testify/assert" "github.com/streamnative/pulsarctl/pkg/cmdutils" + "github.com/streamnative/pulsarctl/pkg/ctl/topic" "github.com/streamnative/pulsarctl/pkg/test" ) // This tests will test all source operations func TestSourcesOperations(t *testing.T) { narFile := path.Join(resourceDir(), "data-generator.nar") - sourceName := "test-source-opt" + test.RandomSuffix() + suffix := test.RandomSuffix() + sourceName := "test-source-opt" + suffix + destinationTopic := "persistent://public/default/source-input-" + suffix defaultArgs := []string{ "--tenant", "public", @@ -42,6 +45,9 @@ func TestSourcesOperations(t *testing.T) { "--name", sourceName, } + _, execErr, _, err := topic.TestTopicCommands(topic.CreateTopicCmd, []string{destinationTopic, "0"}) + failImmediatelyIfErrorNotNil(t, execErr, err) + listArgs := []string{"list"} out, execErr, err := TestSourcesCommands(listSourcesCmd, listArgs) failImmediatelyIfErrorNotNil(t, execErr, err) @@ -49,7 +55,7 @@ func TestSourcesOperations(t *testing.T) { createArgs := []string{ "create", - "--destination-topic-name", "source-input", + "--destination-topic-name", destinationTopic, "--archive", narFile, } out, execErr, err = TestSourcesCommands(createSourcesCmd, append(createArgs, defaultArgs...)) From fb6348cadc0aca7a40a3d5f0294e6e5bcca3e14a Mon Sep 17 00:00:00 2001 From: Jiwei Guo Date: Fri, 1 May 2026 10:24:15 +0800 Subject: [PATCH 06/19] add wait --- pkg/ctl/sinks/opeations_test.go | 32 ++++++++++++++++++++++++++++-- pkg/ctl/sources/operations_test.go | 32 ++++++++++++++++++++++++++++-- 2 files changed, 60 insertions(+), 4 deletions(-) diff --git a/pkg/ctl/sinks/opeations_test.go b/pkg/ctl/sinks/opeations_test.go index 09f93dea..8cb74a0f 100644 --- a/pkg/ctl/sinks/opeations_test.go +++ b/pkg/ctl/sinks/opeations_test.go @@ -78,9 +78,38 @@ func TestSinksOperations(t *testing.T) { assert.Equal(t, "default", sinkConf.Namespace) assert.Equal(t, sinkName, sinkConf.Name) + statusArgs := []string{"status"} + var status utils.SinkStatus + waitForSinkRunning := func(expectedInstances int) { + task := func(args []string, obj interface{}) bool { + out, execErr, err := TestSinksCommands(statusSinksCmd, args) + if err != nil { + fmt.Println(err.Error()) + return false + } + if execErr != nil { + fmt.Println(execErr.Error()) + return false + } + err = json.Unmarshal(out.Bytes(), &obj) + if err != nil { + fmt.Println(err.Error()) + return false + } + s := obj.(*utils.SinkStatus) + return len(s.Instances) == expectedInstances && s.NumRunning == expectedInstances + } + err = cmdutils.RunFuncWithTimeout(task, true, 3*time.Minute, + append(statusArgs, defaultArgs...), &status) + failImmediatelyIfErrorNotNil(t, err) + } + + waitForSinkRunning(1) + updateArgs := []string{"update", "--parallelism", "2"} _, execErr, err = TestSinksCommands(updateSinksCmd, append(updateArgs, defaultArgs...)) failImmediatelyIfErrorNotNil(t, execErr, err) + waitForSinkRunning(2) out, execErr, err = TestSinksCommands(getSinksCmd, append(getArgs, defaultArgs...)) failImmediatelyIfErrorNotNil(t, execErr, err) @@ -96,6 +125,7 @@ func TestSinksOperations(t *testing.T) { updateArgs = []string{"update", "--parallelism", "1"} _, execErr, err = TestSinksCommands(updateSinksCmd, append(updateArgs, defaultArgs...)) failImmediatelyIfErrorNotNil(t, execErr, err) + waitForSinkRunning(1) stopArgs := []string{"stop"} _, execErr, err = TestSinksCommands(stopSinksCmd, append(stopArgs, defaultArgs...)) @@ -105,8 +135,6 @@ func TestSinksOperations(t *testing.T) { _, execErr, err = TestSinksCommands(startSinksCmd, append(startArgs, defaultArgs...)) failImmediatelyIfErrorNotNil(t, execErr, err) - statusArgs := []string{"status"} - var status utils.SinkStatus task := func(args []string, obj interface{}) bool { out, execErr, err := TestSinksCommands(statusSinksCmd, args) if err != nil { diff --git a/pkg/ctl/sources/operations_test.go b/pkg/ctl/sources/operations_test.go index a8b8cdb6..b485df03 100644 --- a/pkg/ctl/sources/operations_test.go +++ b/pkg/ctl/sources/operations_test.go @@ -78,9 +78,38 @@ func TestSourcesOperations(t *testing.T) { assert.Equal(t, "default", sourceConf.Namespace) assert.Equal(t, sourceName, sourceConf.Name) + statusArgs := []string{"status"} + var status utils.SourceStatus + waitForSourceRunning := func(expectedInstances int) { + task := func(args []string, obj interface{}) bool { + out, execErr, err := TestSourcesCommands(statusSourcesCmd, args) + if err != nil { + fmt.Println(err.Error()) + return false + } + if execErr != nil { + fmt.Println(execErr.Error()) + return false + } + err = json.Unmarshal(out.Bytes(), &obj) + if err != nil { + fmt.Println(err.Error()) + return false + } + s := obj.(*utils.SourceStatus) + return len(s.Instances) == expectedInstances && s.NumRunning == expectedInstances + } + err = cmdutils.RunFuncWithTimeout(task, true, 3*time.Minute, + append(statusArgs, defaultArgs...), &status) + failImmediatelyIfErrorNotNil(t, err) + } + + waitForSourceRunning(1) + updateArgs := []string{"update", "--parallelism", "2"} _, execErr, err = TestSourcesCommands(updateSourcesCmd, append(updateArgs, defaultArgs...)) failImmediatelyIfErrorNotNil(t, execErr, err) + waitForSourceRunning(2) out, execErr, err = TestSourcesCommands(getSourcesCmd, append(getArgs, defaultArgs...)) failImmediatelyIfErrorNotNil(t, execErr, err) @@ -96,6 +125,7 @@ func TestSourcesOperations(t *testing.T) { updateArgs = []string{"update", "--parallelism", "1"} _, execErr, err = TestSourcesCommands(updateSourcesCmd, append(updateArgs, defaultArgs...)) failImmediatelyIfErrorNotNil(t, execErr, err) + waitForSourceRunning(1) stopArgs := []string{"stop"} _, execErr, err = TestSourcesCommands(stopSourcesCmd, append(stopArgs, defaultArgs...)) @@ -105,8 +135,6 @@ func TestSourcesOperations(t *testing.T) { _, execErr, err = TestSourcesCommands(startSourcesCmd, append(startArgs, defaultArgs...)) failImmediatelyIfErrorNotNil(t, execErr, err) - statusArgs := []string{"status"} - var status utils.SourceStatus task := func(args []string, obj interface{}) bool { out, execErr, err := TestSourcesCommands(statusSourcesCmd, args) if err != nil { From d68cc51035383d91c4317b9e501675ef95f180f6 Mon Sep 17 00:00:00 2001 From: Jiwei Guo Date: Fri, 1 May 2026 10:41:49 +0800 Subject: [PATCH 07/19] add more log --- pkg/ctl/sinks/opeations_test.go | 5 +++++ pkg/ctl/sources/operations_test.go | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/pkg/ctl/sinks/opeations_test.go b/pkg/ctl/sinks/opeations_test.go index 8cb74a0f..4ae5e819 100644 --- a/pkg/ctl/sinks/opeations_test.go +++ b/pkg/ctl/sinks/opeations_test.go @@ -81,6 +81,7 @@ func TestSinksOperations(t *testing.T) { statusArgs := []string{"status"} var status utils.SinkStatus waitForSinkRunning := func(expectedInstances int) { + lastStatus := "" task := func(args []string, obj interface{}) bool { out, execErr, err := TestSinksCommands(statusSinksCmd, args) if err != nil { @@ -91,6 +92,7 @@ func TestSinksOperations(t *testing.T) { fmt.Println(execErr.Error()) return false } + lastStatus = out.String() err = json.Unmarshal(out.Bytes(), &obj) if err != nil { fmt.Println(err.Error()) @@ -101,6 +103,9 @@ func TestSinksOperations(t *testing.T) { } err = cmdutils.RunFuncWithTimeout(task, true, 3*time.Minute, append(statusArgs, defaultArgs...), &status) + if err != nil && lastStatus != "" { + t.Logf("last sink status before timeout: %s", lastStatus) + } failImmediatelyIfErrorNotNil(t, err) } diff --git a/pkg/ctl/sources/operations_test.go b/pkg/ctl/sources/operations_test.go index b485df03..ea84a544 100644 --- a/pkg/ctl/sources/operations_test.go +++ b/pkg/ctl/sources/operations_test.go @@ -81,6 +81,7 @@ func TestSourcesOperations(t *testing.T) { statusArgs := []string{"status"} var status utils.SourceStatus waitForSourceRunning := func(expectedInstances int) { + lastStatus := "" task := func(args []string, obj interface{}) bool { out, execErr, err := TestSourcesCommands(statusSourcesCmd, args) if err != nil { @@ -91,6 +92,7 @@ func TestSourcesOperations(t *testing.T) { fmt.Println(execErr.Error()) return false } + lastStatus = out.String() err = json.Unmarshal(out.Bytes(), &obj) if err != nil { fmt.Println(err.Error()) @@ -101,6 +103,9 @@ func TestSourcesOperations(t *testing.T) { } err = cmdutils.RunFuncWithTimeout(task, true, 3*time.Minute, append(statusArgs, defaultArgs...), &status) + if err != nil && lastStatus != "" { + t.Logf("last source status before timeout: %s", lastStatus) + } failImmediatelyIfErrorNotNil(t, err) } From 55d06bd007f90dc03c42fc7ee76cc3a0061ff712 Mon Sep 17 00:00:00 2001 From: Jiwei Guo Date: Fri, 1 May 2026 14:51:59 +0800 Subject: [PATCH 08/19] add more log 2 --- scripts/entrypoint.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index 32d91be5..f546acdd 100755 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -5,6 +5,30 @@ set -e readonly PULSARCTL_HOME=${PULSARCTL_HOME:-"/pulsarctl"} readonly TEST_ARGS=${TEST_ARGS:-""} +function ensureJavaInPath() { + if command -v java >/dev/null 2>&1; then + return + fi + + for dir in \ + /opt/java/openjdk/bin \ + /usr/local/openjdk-17/bin \ + /usr/local/openjdk-11/bin \ + /usr/lib/jvm/default-jvm/bin \ + /usr/lib/jvm/java-17-openjdk/bin \ + /usr/lib/jvm/java-11-openjdk/bin + do + if [[ -x "${dir}/java" ]]; then + export PATH="${dir}:${PATH}" + export JAVA_HOME="${dir%/bin}" + return + fi + done + + echo "java executable not found in PATH or common JDK locations" + exit 1 +} + function checkFunctionWorker() { failed=0 until curl --fail --silent --show-error localhost:8080/admin/v2/persistent/public/functions/coordinate/stats >/dev/null; do @@ -20,6 +44,7 @@ function checkFunctionWorker() { } pushd ${PULSARCTL_HOME} +ensureJavaInPath # startup pulsar service scripts/pulsar-service-startup.sh From c80b878c1a8350ba1a54a6a38d4b8bfba21d9966 Mon Sep 17 00:00:00 2001 From: Jiwei Guo Date: Fri, 1 May 2026 14:55:26 +0800 Subject: [PATCH 09/19] add more log 2 --- scripts/entrypoint.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index f546acdd..4425d7d9 100755 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -11,6 +11,7 @@ function ensureJavaInPath() { fi for dir in \ + /opt/jvm/bin \ /opt/java/openjdk/bin \ /usr/local/openjdk-17/bin \ /usr/local/openjdk-11/bin \ From fadccf1b42a7f6da125c34835785d5dc0cebd121 Mon Sep 17 00:00:00 2001 From: Jiwei Guo Date: Fri, 1 May 2026 15:28:59 +0800 Subject: [PATCH 10/19] Revert "add more log" This reverts commit d68cc51035383d91c4317b9e501675ef95f180f6. --- pkg/ctl/sinks/opeations_test.go | 5 ----- pkg/ctl/sources/operations_test.go | 5 ----- 2 files changed, 10 deletions(-) diff --git a/pkg/ctl/sinks/opeations_test.go b/pkg/ctl/sinks/opeations_test.go index 4ae5e819..8cb74a0f 100644 --- a/pkg/ctl/sinks/opeations_test.go +++ b/pkg/ctl/sinks/opeations_test.go @@ -81,7 +81,6 @@ func TestSinksOperations(t *testing.T) { statusArgs := []string{"status"} var status utils.SinkStatus waitForSinkRunning := func(expectedInstances int) { - lastStatus := "" task := func(args []string, obj interface{}) bool { out, execErr, err := TestSinksCommands(statusSinksCmd, args) if err != nil { @@ -92,7 +91,6 @@ func TestSinksOperations(t *testing.T) { fmt.Println(execErr.Error()) return false } - lastStatus = out.String() err = json.Unmarshal(out.Bytes(), &obj) if err != nil { fmt.Println(err.Error()) @@ -103,9 +101,6 @@ func TestSinksOperations(t *testing.T) { } err = cmdutils.RunFuncWithTimeout(task, true, 3*time.Minute, append(statusArgs, defaultArgs...), &status) - if err != nil && lastStatus != "" { - t.Logf("last sink status before timeout: %s", lastStatus) - } failImmediatelyIfErrorNotNil(t, err) } diff --git a/pkg/ctl/sources/operations_test.go b/pkg/ctl/sources/operations_test.go index ea84a544..b485df03 100644 --- a/pkg/ctl/sources/operations_test.go +++ b/pkg/ctl/sources/operations_test.go @@ -81,7 +81,6 @@ func TestSourcesOperations(t *testing.T) { statusArgs := []string{"status"} var status utils.SourceStatus waitForSourceRunning := func(expectedInstances int) { - lastStatus := "" task := func(args []string, obj interface{}) bool { out, execErr, err := TestSourcesCommands(statusSourcesCmd, args) if err != nil { @@ -92,7 +91,6 @@ func TestSourcesOperations(t *testing.T) { fmt.Println(execErr.Error()) return false } - lastStatus = out.String() err = json.Unmarshal(out.Bytes(), &obj) if err != nil { fmt.Println(err.Error()) @@ -103,9 +101,6 @@ func TestSourcesOperations(t *testing.T) { } err = cmdutils.RunFuncWithTimeout(task, true, 3*time.Minute, append(statusArgs, defaultArgs...), &status) - if err != nil && lastStatus != "" { - t.Logf("last source status before timeout: %s", lastStatus) - } failImmediatelyIfErrorNotNil(t, err) } From d0371c72f8727c193fc7890cc36fb3bf15e5c9a5 Mon Sep 17 00:00:00 2001 From: Jiwei Guo Date: Fri, 1 May 2026 15:29:01 +0800 Subject: [PATCH 11/19] Revert "add wait" This reverts commit fb6348cadc0aca7a40a3d5f0294e6e5bcca3e14a. --- pkg/ctl/sinks/opeations_test.go | 32 ++---------------------------- pkg/ctl/sources/operations_test.go | 32 ++---------------------------- 2 files changed, 4 insertions(+), 60 deletions(-) diff --git a/pkg/ctl/sinks/opeations_test.go b/pkg/ctl/sinks/opeations_test.go index 8cb74a0f..09f93dea 100644 --- a/pkg/ctl/sinks/opeations_test.go +++ b/pkg/ctl/sinks/opeations_test.go @@ -78,38 +78,9 @@ func TestSinksOperations(t *testing.T) { assert.Equal(t, "default", sinkConf.Namespace) assert.Equal(t, sinkName, sinkConf.Name) - statusArgs := []string{"status"} - var status utils.SinkStatus - waitForSinkRunning := func(expectedInstances int) { - task := func(args []string, obj interface{}) bool { - out, execErr, err := TestSinksCommands(statusSinksCmd, args) - if err != nil { - fmt.Println(err.Error()) - return false - } - if execErr != nil { - fmt.Println(execErr.Error()) - return false - } - err = json.Unmarshal(out.Bytes(), &obj) - if err != nil { - fmt.Println(err.Error()) - return false - } - s := obj.(*utils.SinkStatus) - return len(s.Instances) == expectedInstances && s.NumRunning == expectedInstances - } - err = cmdutils.RunFuncWithTimeout(task, true, 3*time.Minute, - append(statusArgs, defaultArgs...), &status) - failImmediatelyIfErrorNotNil(t, err) - } - - waitForSinkRunning(1) - updateArgs := []string{"update", "--parallelism", "2"} _, execErr, err = TestSinksCommands(updateSinksCmd, append(updateArgs, defaultArgs...)) failImmediatelyIfErrorNotNil(t, execErr, err) - waitForSinkRunning(2) out, execErr, err = TestSinksCommands(getSinksCmd, append(getArgs, defaultArgs...)) failImmediatelyIfErrorNotNil(t, execErr, err) @@ -125,7 +96,6 @@ func TestSinksOperations(t *testing.T) { updateArgs = []string{"update", "--parallelism", "1"} _, execErr, err = TestSinksCommands(updateSinksCmd, append(updateArgs, defaultArgs...)) failImmediatelyIfErrorNotNil(t, execErr, err) - waitForSinkRunning(1) stopArgs := []string{"stop"} _, execErr, err = TestSinksCommands(stopSinksCmd, append(stopArgs, defaultArgs...)) @@ -135,6 +105,8 @@ func TestSinksOperations(t *testing.T) { _, execErr, err = TestSinksCommands(startSinksCmd, append(startArgs, defaultArgs...)) failImmediatelyIfErrorNotNil(t, execErr, err) + statusArgs := []string{"status"} + var status utils.SinkStatus task := func(args []string, obj interface{}) bool { out, execErr, err := TestSinksCommands(statusSinksCmd, args) if err != nil { diff --git a/pkg/ctl/sources/operations_test.go b/pkg/ctl/sources/operations_test.go index b485df03..a8b8cdb6 100644 --- a/pkg/ctl/sources/operations_test.go +++ b/pkg/ctl/sources/operations_test.go @@ -78,38 +78,9 @@ func TestSourcesOperations(t *testing.T) { assert.Equal(t, "default", sourceConf.Namespace) assert.Equal(t, sourceName, sourceConf.Name) - statusArgs := []string{"status"} - var status utils.SourceStatus - waitForSourceRunning := func(expectedInstances int) { - task := func(args []string, obj interface{}) bool { - out, execErr, err := TestSourcesCommands(statusSourcesCmd, args) - if err != nil { - fmt.Println(err.Error()) - return false - } - if execErr != nil { - fmt.Println(execErr.Error()) - return false - } - err = json.Unmarshal(out.Bytes(), &obj) - if err != nil { - fmt.Println(err.Error()) - return false - } - s := obj.(*utils.SourceStatus) - return len(s.Instances) == expectedInstances && s.NumRunning == expectedInstances - } - err = cmdutils.RunFuncWithTimeout(task, true, 3*time.Minute, - append(statusArgs, defaultArgs...), &status) - failImmediatelyIfErrorNotNil(t, err) - } - - waitForSourceRunning(1) - updateArgs := []string{"update", "--parallelism", "2"} _, execErr, err = TestSourcesCommands(updateSourcesCmd, append(updateArgs, defaultArgs...)) failImmediatelyIfErrorNotNil(t, execErr, err) - waitForSourceRunning(2) out, execErr, err = TestSourcesCommands(getSourcesCmd, append(getArgs, defaultArgs...)) failImmediatelyIfErrorNotNil(t, execErr, err) @@ -125,7 +96,6 @@ func TestSourcesOperations(t *testing.T) { updateArgs = []string{"update", "--parallelism", "1"} _, execErr, err = TestSourcesCommands(updateSourcesCmd, append(updateArgs, defaultArgs...)) failImmediatelyIfErrorNotNil(t, execErr, err) - waitForSourceRunning(1) stopArgs := []string{"stop"} _, execErr, err = TestSourcesCommands(stopSourcesCmd, append(stopArgs, defaultArgs...)) @@ -135,6 +105,8 @@ func TestSourcesOperations(t *testing.T) { _, execErr, err = TestSourcesCommands(startSourcesCmd, append(startArgs, defaultArgs...)) failImmediatelyIfErrorNotNil(t, execErr, err) + statusArgs := []string{"status"} + var status utils.SourceStatus task := func(args []string, obj interface{}) bool { out, execErr, err := TestSourcesCommands(statusSourcesCmd, args) if err != nil { From 7aeeb4db41f8d6c5df9f04b2e7ea947b2c7ba061 Mon Sep 17 00:00:00 2001 From: Jiwei Guo Date: Fri, 1 May 2026 15:29:03 +0800 Subject: [PATCH 12/19] Revert "create topic" This reverts commit b61b12fefb2e2c520c93b334fe9df66517575a56. --- pkg/ctl/sinks/opeations_test.go | 10 ++-------- pkg/ctl/sources/operations_test.go | 10 ++-------- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/pkg/ctl/sinks/opeations_test.go b/pkg/ctl/sinks/opeations_test.go index 09f93dea..256716ea 100644 --- a/pkg/ctl/sinks/opeations_test.go +++ b/pkg/ctl/sinks/opeations_test.go @@ -28,16 +28,13 @@ import ( "github.com/stretchr/testify/assert" "github.com/streamnative/pulsarctl/pkg/cmdutils" - "github.com/streamnative/pulsarctl/pkg/ctl/topic" "github.com/streamnative/pulsarctl/pkg/test" ) // This tests will test all sink operations func TestSinksOperations(t *testing.T) { narFile := path.Join(resourceDir(), "data-generator.nar") - suffix := test.RandomSuffix() - sinkName := "test-sink-opt" + suffix - inputTopic := "persistent://public/default/sink-input-" + suffix + sinkName := "test-sink-opt" + test.RandomSuffix() defaultArgs := []string{ "--tenant", "public", @@ -45,9 +42,6 @@ func TestSinksOperations(t *testing.T) { "--name", sinkName, } - _, execErr, _, err := topic.TestTopicCommands(topic.CreateTopicCmd, []string{inputTopic, "0"}) - failImmediatelyIfErrorNotNil(t, execErr, err) - listArgs := []string{"list"} out, execErr, err := TestSinksCommands(listSinksCmd, listArgs) failImmediatelyIfErrorNotNil(t, execErr, err) @@ -55,7 +49,7 @@ func TestSinksOperations(t *testing.T) { createArgs := []string{ "create", - "--inputs", inputTopic, + "--inputs", "sink-input", "--archive", narFile, } out, execErr, err = TestSinksCommands(createSinksCmd, append(createArgs, defaultArgs...)) diff --git a/pkg/ctl/sources/operations_test.go b/pkg/ctl/sources/operations_test.go index a8b8cdb6..af15950a 100644 --- a/pkg/ctl/sources/operations_test.go +++ b/pkg/ctl/sources/operations_test.go @@ -28,16 +28,13 @@ import ( "github.com/stretchr/testify/assert" "github.com/streamnative/pulsarctl/pkg/cmdutils" - "github.com/streamnative/pulsarctl/pkg/ctl/topic" "github.com/streamnative/pulsarctl/pkg/test" ) // This tests will test all source operations func TestSourcesOperations(t *testing.T) { narFile := path.Join(resourceDir(), "data-generator.nar") - suffix := test.RandomSuffix() - sourceName := "test-source-opt" + suffix - destinationTopic := "persistent://public/default/source-input-" + suffix + sourceName := "test-source-opt" + test.RandomSuffix() defaultArgs := []string{ "--tenant", "public", @@ -45,9 +42,6 @@ func TestSourcesOperations(t *testing.T) { "--name", sourceName, } - _, execErr, _, err := topic.TestTopicCommands(topic.CreateTopicCmd, []string{destinationTopic, "0"}) - failImmediatelyIfErrorNotNil(t, execErr, err) - listArgs := []string{"list"} out, execErr, err := TestSourcesCommands(listSourcesCmd, listArgs) failImmediatelyIfErrorNotNil(t, execErr, err) @@ -55,7 +49,7 @@ func TestSourcesOperations(t *testing.T) { createArgs := []string{ "create", - "--destination-topic-name", destinationTopic, + "--destination-topic-name", "source-input", "--archive", narFile, } out, execErr, err = TestSourcesCommands(createSourcesCmd, append(createArgs, defaultArgs...)) From 16aafbdf02a4b4bb55e5bdb43e2edc3d8e8caa6b Mon Sep 17 00:00:00 2001 From: Jiwei Guo Date: Fri, 1 May 2026 15:29:04 +0800 Subject: [PATCH 13/19] Revert "fix test" This reverts commit d1f982587000cefc3f523263dcde8d4174ff61a8. --- .github/workflows/ci-auth-checks.yml | 1 + .github/workflows/ci-checks.yml | 1 + .github/workflows/ci-functions-checks.yml | 3 +++ .github/workflows/ci-install-script-checks.yml | 1 + .github/workflows/ci-packages-checks.yml | 1 + 5 files changed, 7 insertions(+) diff --git a/.github/workflows/ci-auth-checks.yml b/.github/workflows/ci-auth-checks.yml index 0541a462..b25f455e 100644 --- a/.github/workflows/ci-auth-checks.yml +++ b/.github/workflows/ci-auth-checks.yml @@ -13,6 +13,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Login SN docker hub + if: github.actor == 'streamnativebot' run: docker login -u="${{ secrets.DOCKER_USER }}" -p="${{ secrets.DOCKER_PASSWORD}}" - name: Run token tests run: scripts/run-integration-tests.sh token diff --git a/.github/workflows/ci-checks.yml b/.github/workflows/ci-checks.yml index c10318f2..240b2aeb 100644 --- a/.github/workflows/ci-checks.yml +++ b/.github/workflows/ci-checks.yml @@ -12,6 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Login SN docker hub + if: github.actor == 'streamnativebot' run: docker login -u="${{ secrets.DOCKER_USER }}" -p="${{ secrets.DOCKER_PASSWORD}}" - uses: actions/checkout@v2 - name: Run tests diff --git a/.github/workflows/ci-functions-checks.yml b/.github/workflows/ci-functions-checks.yml index d4199c01..3a13ed3e 100644 --- a/.github/workflows/ci-functions-checks.yml +++ b/.github/workflows/ci-functions-checks.yml @@ -12,6 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Login SN docker hub + if: github.actor == 'streamnativebot' run: docker login -u="${{ secrets.DOCKER_USER }}" -p="${{ secrets.DOCKER_PASSWORD}}" - name: Set up Go 1.25.9 uses: actions/setup-go@v6 @@ -31,6 +32,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Login SN docker hub + if: github.actor == 'streamnativebot' run: docker login -u="${{ secrets.DOCKER_USER }}" -p="${{ secrets.DOCKER_PASSWORD}}" - name: Set up Go 1.25.9 uses: actions/setup-go@v6 @@ -47,6 +49,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Login SN docker hub + if: github.actor == 'streamnativebot' run: docker login -u="${{ secrets.DOCKER_USER }}" -p="${{ secrets.DOCKER_PASSWORD}}" - name: Set up Go 1.25.9 uses: actions/setup-go@v6 diff --git a/.github/workflows/ci-install-script-checks.yml b/.github/workflows/ci-install-script-checks.yml index aba93c6a..3bba5276 100644 --- a/.github/workflows/ci-install-script-checks.yml +++ b/.github/workflows/ci-install-script-checks.yml @@ -11,6 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Login SN docker hub + if: github.actor == 'streamnativebot' run: docker login -u="${{ secrets.DOCKER_USER }}" -p="${{ secrets.DOCKER_PASSWORD}}" - name: Check out code into the Go module directory uses: actions/checkout@v2 diff --git a/.github/workflows/ci-packages-checks.yml b/.github/workflows/ci-packages-checks.yml index 3b7277d5..497d9d56 100644 --- a/.github/workflows/ci-packages-checks.yml +++ b/.github/workflows/ci-packages-checks.yml @@ -12,6 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Login SN docker hub + if: github.actor == 'streamnativebot' run: docker login -u="${{ secrets.DOCKER_USER }}" -p="${{ secrets.DOCKER_PASSWORD}}" - name: Set up Go 1.25.9 uses: actions/setup-go@v5 From ff8a83054bb28d6b3e7f8310ebe364a8b8716e5b Mon Sep 17 00:00:00 2001 From: Jiwei Guo Date: Fri, 1 May 2026 15:29:05 +0800 Subject: [PATCH 14/19] Revert "fix test" This reverts commit 49bc52d13f80d825b5029c0db4da13a30eb87609. --- .github/workflows/ci-auth-checks.yml | 4 ++-- .github/workflows/ci-checks.yml | 2 +- .github/workflows/ci-functions-checks.yml | 6 +++--- .github/workflows/ci-packages-checks.yml | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-auth-checks.yml b/.github/workflows/ci-auth-checks.yml index b25f455e..7c5b7a50 100644 --- a/.github/workflows/ci-auth-checks.yml +++ b/.github/workflows/ci-auth-checks.yml @@ -18,8 +18,8 @@ jobs: - name: Run token tests run: scripts/run-integration-tests.sh token env: - PULSAR_IMAGE: snstage/pulsar-all + PULSAR_IMAGE: ${{ github.actor == 'streamnativebot' && 'snstage/pulsar-all' || 'apachepulsar/pulsar-all' }} - name: Run TLS tests run: scripts/run-integration-tests.sh tls env: - PULSAR_IMAGE: snstage/pulsar-all + PULSAR_IMAGE: ${{ github.actor == 'streamnativebot' && 'snstage/pulsar-all' || 'apachepulsar/pulsar-all' }} diff --git a/.github/workflows/ci-checks.yml b/.github/workflows/ci-checks.yml index 240b2aeb..fca8ca51 100644 --- a/.github/workflows/ci-checks.yml +++ b/.github/workflows/ci-checks.yml @@ -18,4 +18,4 @@ jobs: - name: Run tests run: scripts/run-integration-tests.sh env: - PULSAR_IMAGE: snstage/pulsar-all + PULSAR_IMAGE: ${{ github.actor == 'streamnativebot' && 'snstage/pulsar-all' || 'apachepulsar/pulsar-all' }} diff --git a/.github/workflows/ci-functions-checks.yml b/.github/workflows/ci-functions-checks.yml index 3a13ed3e..c3333b00 100644 --- a/.github/workflows/ci-functions-checks.yml +++ b/.github/workflows/ci-functions-checks.yml @@ -24,7 +24,7 @@ jobs: - name: Function tests run: scripts/run-integration-tests.sh function env: - PULSAR_IMAGE: snstage/pulsar-all + PULSAR_IMAGE: ${{ github.actor == 'streamnativebot' && 'snstage/pulsar-all' || 'apachepulsar/pulsar-all' }} - name: Setup tmate session if: failure() uses: mxschmitt/action-tmate@v3 @@ -44,7 +44,7 @@ jobs: - name: Sink tests run: scripts/run-integration-tests.sh sink env: - PULSAR_IMAGE: snstage/pulsar-all + PULSAR_IMAGE: ${{ github.actor == 'streamnativebot' && 'snstage/pulsar-all' || 'apachepulsar/pulsar-all' }} source-tests: runs-on: ubuntu-latest steps: @@ -61,4 +61,4 @@ jobs: - name: Source tests run: scripts/run-integration-tests.sh source env: - PULSAR_IMAGE: snstage/pulsar-all + PULSAR_IMAGE: ${{ github.actor == 'streamnativebot' && 'snstage/pulsar-all' || 'apachepulsar/pulsar-all' }} diff --git a/.github/workflows/ci-packages-checks.yml b/.github/workflows/ci-packages-checks.yml index 497d9d56..c2b69b9c 100644 --- a/.github/workflows/ci-packages-checks.yml +++ b/.github/workflows/ci-packages-checks.yml @@ -24,7 +24,7 @@ jobs: - name: Packages tests run: scripts/run-integration-tests.sh packages env: - PULSAR_IMAGE: snstage/pulsar-all + PULSAR_IMAGE: ${{ github.actor == 'streamnativebot' && 'snstage/pulsar-all' || 'apachepulsar/pulsar-all' }} - name: Setup tmate session if: failure() uses: mxschmitt/action-tmate@v3 From 693c74473d6aab5d8fb2df6a55002c89ef772686 Mon Sep 17 00:00:00 2001 From: Jiwei Guo Date: Fri, 1 May 2026 15:30:18 +0800 Subject: [PATCH 15/19] Revert "fix test" This reverts commit 394981d6377427777333bfd5be0f8e316fe4fca4. --- scripts/entrypoint.sh | 2 +- test/script/check.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index 4425d7d9..2a229a2d 100755 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -32,7 +32,7 @@ function ensureJavaInPath() { function checkFunctionWorker() { failed=0 - until curl --fail --silent --show-error localhost:8080/admin/v2/persistent/public/functions/coordinate/stats >/dev/null; do + until curl --silent localhost:8080/admin/v2/persistent/public/functions/coordinate/stats; do echo "waiting function worker service start..." failed=`expr ${failed} + 1` if [[ ${failed} == 30 ]]; then diff --git a/test/script/check.sh b/test/script/check.sh index a4a5794b..5ad888b1 100755 --- a/test/script/check.sh +++ b/test/script/check.sh @@ -18,7 +18,7 @@ function checkBookieHTTP() { function checkFunctionWorker() { failed=0 - until curl --fail --silent --show-error localhost:8080/admin/v2/persistent/public/functions/coordinate/stats >/dev/null; do + until curl localhost:8080/admin/v2/persistent/public/functions/coordinate/stats; do echo "waiting function worker service start..." failed=`expr ${failed} + 1` if [[ ${failed} == 30 ]]; then @@ -37,4 +37,4 @@ case $1 in *) echo Which service you would like to check? echo Available service: bookieHTTP, functionWorker ;; -esac +esac \ No newline at end of file From 3f360d1657be20b9afea53052c98692527b7fe7d Mon Sep 17 00:00:00 2001 From: Jiwei Guo Date: Fri, 1 May 2026 09:50:04 +0800 Subject: [PATCH 16/19] fix test --- scripts/entrypoint.sh | 2 +- test/script/check.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index 2a229a2d..4425d7d9 100755 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -32,7 +32,7 @@ function ensureJavaInPath() { function checkFunctionWorker() { failed=0 - until curl --silent localhost:8080/admin/v2/persistent/public/functions/coordinate/stats; do + until curl --fail --silent --show-error localhost:8080/admin/v2/persistent/public/functions/coordinate/stats >/dev/null; do echo "waiting function worker service start..." failed=`expr ${failed} + 1` if [[ ${failed} == 30 ]]; then diff --git a/test/script/check.sh b/test/script/check.sh index 5ad888b1..a4a5794b 100755 --- a/test/script/check.sh +++ b/test/script/check.sh @@ -18,7 +18,7 @@ function checkBookieHTTP() { function checkFunctionWorker() { failed=0 - until curl localhost:8080/admin/v2/persistent/public/functions/coordinate/stats; do + until curl --fail --silent --show-error localhost:8080/admin/v2/persistent/public/functions/coordinate/stats >/dev/null; do echo "waiting function worker service start..." failed=`expr ${failed} + 1` if [[ ${failed} == 30 ]]; then @@ -37,4 +37,4 @@ case $1 in *) echo Which service you would like to check? echo Available service: bookieHTTP, functionWorker ;; -esac \ No newline at end of file +esac From 56826265685515177e3cd73b135ab9268f5f03b6 Mon Sep 17 00:00:00 2001 From: Jiwei Guo Date: Fri, 1 May 2026 10:01:12 +0800 Subject: [PATCH 17/19] fix test --- .github/workflows/ci-auth-checks.yml | 1 - .github/workflows/ci-checks.yml | 1 - .github/workflows/ci-functions-checks.yml | 3 --- .github/workflows/ci-install-script-checks.yml | 1 - .github/workflows/ci-packages-checks.yml | 1 - 5 files changed, 7 deletions(-) diff --git a/.github/workflows/ci-auth-checks.yml b/.github/workflows/ci-auth-checks.yml index 7c5b7a50..0e09b6e2 100644 --- a/.github/workflows/ci-auth-checks.yml +++ b/.github/workflows/ci-auth-checks.yml @@ -13,7 +13,6 @@ jobs: steps: - uses: actions/checkout@v2 - name: Login SN docker hub - if: github.actor == 'streamnativebot' run: docker login -u="${{ secrets.DOCKER_USER }}" -p="${{ secrets.DOCKER_PASSWORD}}" - name: Run token tests run: scripts/run-integration-tests.sh token diff --git a/.github/workflows/ci-checks.yml b/.github/workflows/ci-checks.yml index fca8ca51..5c71120e 100644 --- a/.github/workflows/ci-checks.yml +++ b/.github/workflows/ci-checks.yml @@ -12,7 +12,6 @@ jobs: runs-on: ubuntu-latest steps: - name: Login SN docker hub - if: github.actor == 'streamnativebot' run: docker login -u="${{ secrets.DOCKER_USER }}" -p="${{ secrets.DOCKER_PASSWORD}}" - uses: actions/checkout@v2 - name: Run tests diff --git a/.github/workflows/ci-functions-checks.yml b/.github/workflows/ci-functions-checks.yml index c3333b00..9b23faf1 100644 --- a/.github/workflows/ci-functions-checks.yml +++ b/.github/workflows/ci-functions-checks.yml @@ -12,7 +12,6 @@ jobs: runs-on: ubuntu-latest steps: - name: Login SN docker hub - if: github.actor == 'streamnativebot' run: docker login -u="${{ secrets.DOCKER_USER }}" -p="${{ secrets.DOCKER_PASSWORD}}" - name: Set up Go 1.25.9 uses: actions/setup-go@v6 @@ -32,7 +31,6 @@ jobs: runs-on: ubuntu-latest steps: - name: Login SN docker hub - if: github.actor == 'streamnativebot' run: docker login -u="${{ secrets.DOCKER_USER }}" -p="${{ secrets.DOCKER_PASSWORD}}" - name: Set up Go 1.25.9 uses: actions/setup-go@v6 @@ -49,7 +47,6 @@ jobs: runs-on: ubuntu-latest steps: - name: Login SN docker hub - if: github.actor == 'streamnativebot' run: docker login -u="${{ secrets.DOCKER_USER }}" -p="${{ secrets.DOCKER_PASSWORD}}" - name: Set up Go 1.25.9 uses: actions/setup-go@v6 diff --git a/.github/workflows/ci-install-script-checks.yml b/.github/workflows/ci-install-script-checks.yml index 3bba5276..aba93c6a 100644 --- a/.github/workflows/ci-install-script-checks.yml +++ b/.github/workflows/ci-install-script-checks.yml @@ -11,7 +11,6 @@ jobs: runs-on: ubuntu-latest steps: - name: Login SN docker hub - if: github.actor == 'streamnativebot' run: docker login -u="${{ secrets.DOCKER_USER }}" -p="${{ secrets.DOCKER_PASSWORD}}" - name: Check out code into the Go module directory uses: actions/checkout@v2 diff --git a/.github/workflows/ci-packages-checks.yml b/.github/workflows/ci-packages-checks.yml index c2b69b9c..0acdc601 100644 --- a/.github/workflows/ci-packages-checks.yml +++ b/.github/workflows/ci-packages-checks.yml @@ -12,7 +12,6 @@ jobs: runs-on: ubuntu-latest steps: - name: Login SN docker hub - if: github.actor == 'streamnativebot' run: docker login -u="${{ secrets.DOCKER_USER }}" -p="${{ secrets.DOCKER_PASSWORD}}" - name: Set up Go 1.25.9 uses: actions/setup-go@v5 From 23e59b955982c91f09d17e5e3e92dd32b57c575a Mon Sep 17 00:00:00 2001 From: Jiwei Guo Date: Fri, 1 May 2026 09:57:05 +0800 Subject: [PATCH 18/19] fix test --- .github/workflows/ci-auth-checks.yml | 4 ++-- .github/workflows/ci-checks.yml | 2 +- .github/workflows/ci-functions-checks.yml | 6 +++--- .github/workflows/ci-packages-checks.yml | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-auth-checks.yml b/.github/workflows/ci-auth-checks.yml index 0e09b6e2..0541a462 100644 --- a/.github/workflows/ci-auth-checks.yml +++ b/.github/workflows/ci-auth-checks.yml @@ -17,8 +17,8 @@ jobs: - name: Run token tests run: scripts/run-integration-tests.sh token env: - PULSAR_IMAGE: ${{ github.actor == 'streamnativebot' && 'snstage/pulsar-all' || 'apachepulsar/pulsar-all' }} + PULSAR_IMAGE: snstage/pulsar-all - name: Run TLS tests run: scripts/run-integration-tests.sh tls env: - PULSAR_IMAGE: ${{ github.actor == 'streamnativebot' && 'snstage/pulsar-all' || 'apachepulsar/pulsar-all' }} + PULSAR_IMAGE: snstage/pulsar-all diff --git a/.github/workflows/ci-checks.yml b/.github/workflows/ci-checks.yml index 5c71120e..c10318f2 100644 --- a/.github/workflows/ci-checks.yml +++ b/.github/workflows/ci-checks.yml @@ -17,4 +17,4 @@ jobs: - name: Run tests run: scripts/run-integration-tests.sh env: - PULSAR_IMAGE: ${{ github.actor == 'streamnativebot' && 'snstage/pulsar-all' || 'apachepulsar/pulsar-all' }} + PULSAR_IMAGE: snstage/pulsar-all diff --git a/.github/workflows/ci-functions-checks.yml b/.github/workflows/ci-functions-checks.yml index 9b23faf1..d4199c01 100644 --- a/.github/workflows/ci-functions-checks.yml +++ b/.github/workflows/ci-functions-checks.yml @@ -23,7 +23,7 @@ jobs: - name: Function tests run: scripts/run-integration-tests.sh function env: - PULSAR_IMAGE: ${{ github.actor == 'streamnativebot' && 'snstage/pulsar-all' || 'apachepulsar/pulsar-all' }} + PULSAR_IMAGE: snstage/pulsar-all - name: Setup tmate session if: failure() uses: mxschmitt/action-tmate@v3 @@ -42,7 +42,7 @@ jobs: - name: Sink tests run: scripts/run-integration-tests.sh sink env: - PULSAR_IMAGE: ${{ github.actor == 'streamnativebot' && 'snstage/pulsar-all' || 'apachepulsar/pulsar-all' }} + PULSAR_IMAGE: snstage/pulsar-all source-tests: runs-on: ubuntu-latest steps: @@ -58,4 +58,4 @@ jobs: - name: Source tests run: scripts/run-integration-tests.sh source env: - PULSAR_IMAGE: ${{ github.actor == 'streamnativebot' && 'snstage/pulsar-all' || 'apachepulsar/pulsar-all' }} + PULSAR_IMAGE: snstage/pulsar-all diff --git a/.github/workflows/ci-packages-checks.yml b/.github/workflows/ci-packages-checks.yml index 0acdc601..3b7277d5 100644 --- a/.github/workflows/ci-packages-checks.yml +++ b/.github/workflows/ci-packages-checks.yml @@ -23,7 +23,7 @@ jobs: - name: Packages tests run: scripts/run-integration-tests.sh packages env: - PULSAR_IMAGE: ${{ github.actor == 'streamnativebot' && 'snstage/pulsar-all' || 'apachepulsar/pulsar-all' }} + PULSAR_IMAGE: snstage/pulsar-all - name: Setup tmate session if: failure() uses: mxschmitt/action-tmate@v3 From 9d1bb8ccb1bad3d46538c691f04e61038d16d13c Mon Sep 17 00:00:00 2001 From: Jiwei Guo Date: Fri, 1 May 2026 15:33:24 +0800 Subject: [PATCH 19/19] Revert "fix test" This reverts commit 3f360d1657be20b9afea53052c98692527b7fe7d. --- scripts/entrypoint.sh | 2 +- test/script/check.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index 4425d7d9..2a229a2d 100755 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -32,7 +32,7 @@ function ensureJavaInPath() { function checkFunctionWorker() { failed=0 - until curl --fail --silent --show-error localhost:8080/admin/v2/persistent/public/functions/coordinate/stats >/dev/null; do + until curl --silent localhost:8080/admin/v2/persistent/public/functions/coordinate/stats; do echo "waiting function worker service start..." failed=`expr ${failed} + 1` if [[ ${failed} == 30 ]]; then diff --git a/test/script/check.sh b/test/script/check.sh index a4a5794b..5ad888b1 100755 --- a/test/script/check.sh +++ b/test/script/check.sh @@ -18,7 +18,7 @@ function checkBookieHTTP() { function checkFunctionWorker() { failed=0 - until curl --fail --silent --show-error localhost:8080/admin/v2/persistent/public/functions/coordinate/stats >/dev/null; do + until curl localhost:8080/admin/v2/persistent/public/functions/coordinate/stats; do echo "waiting function worker service start..." failed=`expr ${failed} + 1` if [[ ${failed} == 30 ]]; then @@ -37,4 +37,4 @@ case $1 in *) echo Which service you would like to check? echo Available service: bookieHTTP, functionWorker ;; -esac +esac \ No newline at end of file