Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,12 @@ jobs:
with:
go-version: ${{ matrix.go-version }}
- name: Run Tests
id: run-tests
run: make test GO_VERSION=${{ matrix.go-version }}
- name: Upload logs on failure
if: failure() && steps.run-tests.outcome == 'failure'
uses: actions/upload-artifact@v4
with:
name: test-logs-${{ matrix.go-version }}
path: logs/
retention-days: 7
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,23 +61,23 @@ container:
test: container test_standalone test_clustered test_extensible_load_manager

test_standalone: container
docker run -v /var/run/docker.sock:/var/run/docker.sock ${DOCKER_TEST_ARGS} bash -c "cd /pulsar/pulsar-client-go && ./scripts/run-ci.sh"
docker run -v /var/run/docker.sock:/var/run/docker.sock -v $(shell pwd)/logs:/pulsar/logs ${DOCKER_TEST_ARGS} bash -c "cd /pulsar/pulsar-client-go && ./scripts/run-ci.sh"

test_clustered: container
PULSAR_VERSION=${PULSAR_VERSION} docker compose -f integration-tests/clustered/docker-compose.yml up -d
until curl http://localhost:8080/metrics > /dev/null 2>&1; do sleep 1; done
docker run --network=clustered_pulsar ${DOCKER_TEST_ARGS} bash -c "cd /pulsar/pulsar-client-go && ./scripts/run-ci-clustered.sh"
docker run --network=clustered_pulsar -v $(shell pwd)/logs:/pulsar/logs ${DOCKER_TEST_ARGS} bash -c "cd /pulsar/pulsar-client-go && ./scripts/run-ci-clustered.sh"
PULSAR_VERSION=${PULSAR_VERSION} docker compose -f integration-tests/clustered/docker-compose.yml down

test_extensible_load_manager: container
PULSAR_VERSION=${PULSAR_VERSION} docker compose -f integration-tests/extensible-load-manager/docker-compose.yml up -d
until curl http://localhost:8080/metrics > /dev/null 2>&1; do sleep 1; done
docker run --network=extensible-load-manager_pulsar ${DOCKER_TEST_ARGS} bash -c "cd /pulsar/pulsar-client-go && ./scripts/run-ci-extensible-load-manager.sh"
docker run --network=extensible-load-manager_pulsar -v $(shell pwd)/logs:/pulsar/logs ${DOCKER_TEST_ARGS} bash -c "cd /pulsar/pulsar-client-go && ./scripts/run-ci-extensible-load-manager.sh"

PULSAR_VERSION=${PULSAR_VERSION} docker compose -f integration-tests/blue-green/docker-compose.yml up -d
until curl http://localhost:8081/metrics > /dev/null 2>&1 ; do sleep 1; done

docker run --network=extensible-load-manager_pulsar ${DOCKER_TEST_ARGS} bash -c "cd /pulsar/pulsar-client-go && ./scripts/run-ci-blue-green-cluster.sh"
docker run --network=extensible-load-manager_pulsar -v $(shell pwd)/logs:/pulsar/logs ${DOCKER_TEST_ARGS} bash -c "cd /pulsar/pulsar-client-go && ./scripts/run-ci-blue-green-cluster.sh"
PULSAR_VERSION=${PULSAR_VERSION} docker compose -f integration-tests/blue-green/docker-compose.yml down
PULSAR_VERSION=${PULSAR_VERSION} docker compose -f integration-tests/extensible-load-manager/docker-compose.yml down

Expand Down
10 changes: 6 additions & 4 deletions pulsar/reader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1029,8 +1029,8 @@ func TestReaderHasNextRetryFailed(t *testing.T) {
close(req.doneCh)
}
}()
minTimer := time.NewTimer(1 * time.Second) // Timer to check if r.HasNext() blocked for at least 1s
maxTimer := time.NewTimer(3 * time.Second) // Timer to ensure r.HasNext() doesn't block for more than 3s
maxTimer := time.NewTimer(8 * time.Second) // Timer to ensure r.HasNext() doesn't block for more than 3s
startTime := time.Now().UnixMilli()
done := make(chan bool)
go func() {
assert.False(t, r.HasNext())
Expand All @@ -1041,8 +1041,10 @@ func TestReaderHasNextRetryFailed(t *testing.T) {
case <-maxTimer.C:
t.Fatal("r.HasNext() blocked for more than 3s")
case <-done:
assert.False(t, minTimer.Stop(), "r.HasNext() did not block for at least 1s")
assert.True(t, maxTimer.Stop())
now := time.Now().UnixMilli()
if now-startTime < 1000 {
t.Fatal("r.HasNext() blocked for less than 1s")
}
}

}
Expand Down
1 change: 1 addition & 0 deletions scripts/run-ci-blue-green-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# under the License.

set -x
set -o pipefail

TEST_LOG=/tmp/test-log-$(date +%s).log

Expand Down
1 change: 1 addition & 0 deletions scripts/run-ci-clustered.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# under the License.

set -x
set -o pipefail

TEST_LOG=/tmp/test-log-$(date +%s).log

Expand Down
1 change: 1 addition & 0 deletions scripts/run-ci-extensible-load-manager.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# under the License.

set -x
set -o pipefail

TEST_LOG=/tmp/test-log-$(date +%s).log

Expand Down
1 change: 1 addition & 0 deletions scripts/run-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@


set -x
set -o pipefail

scripts/pulsar-test-service-start.sh

Expand Down
Loading