Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(fvt): versioned cfg for invalid topic producer #2613

Merged
merged 2 commits into from
Aug 21, 2023
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
19 changes: 18 additions & 1 deletion .github/workflows/fvt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,27 @@ jobs:
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Test (Functional)
- name: Setup Docker Compose
run: |
curl -sSL "https://github.com/docker/compose/releases/download/v2.20.3/docker-compose-$(uname -s)-$(uname -m)" -o /tmp/docker-compose
sudo install -m755 /tmp/docker-compose "$(dirname $(which docker-compose))"
docker version --format 'Docker Engine version v{{.Server.Version}}'
docker-compose version
- name: Test (Functional)
run: |
nohup sudo tcpdump -i lo -w "fvt-kafka-${{ matrix.kafka-version }}.pcap" portrange 29091-29095 >/dev/null 2>&1 &
echo $! >tcpdump.pid
make test_functional
- name: Stop tcpdump
if: always()
run: |
if [ -f "tcpdump.pid" ]; then sudo kill "$(cat tcpdump.pid)" || true; fi
if [ -f "fvt-kafka-${{ matrix.kafka-version }}.pcap" ]; then sudo chmod a+r "fvt-kafka-${{ matrix.kafka-version }}.pcap"; fi
- name: Upload pcap file
if: always()
uses: actions/upload-artifact@v3
with:
name: fvt-kafka-${{ matrix.kafka-version }}.pcap
path: fvt-kafka-${{ matrix.kafka-version }}.pcap
retention-days: 5
if-no-files-found: ignore
9 changes: 6 additions & 3 deletions functional_producer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,9 @@ func TestFuncProducingToInvalidTopic(t *testing.T) {
setupFunctionalTest(t)
defer teardownFunctionalTest(t)

producer, err := NewSyncProducer(FunctionalTestEnv.KafkaBrokerAddrs, nil)
config := NewFunctionalTestConfig()
config.Producer.Return.Successes = true
producer, err := NewSyncProducer(FunctionalTestEnv.KafkaBrokerAddrs, config)
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -807,7 +809,6 @@ func testProducingMessages(t *testing.T, config *Config, minVersion KafkaVersion
}
}

config.ClientID = t.Name()
config.Producer.Return.Successes = true
config.Consumer.Return.Errors = true

Expand All @@ -822,7 +823,9 @@ func testProducingMessages(t *testing.T, config *Config, minVersion KafkaVersion
}

for version := range kafkaVersions {
t.Run(t.Name()+"-v"+version.String(), func(t *testing.T) {
name := t.Name() + "-v" + version.String()
t.Run(name, func(t *testing.T) {
config.ClientID = name
checkKafkaVersion(t, version.String())
config.Version = version
client, err := NewClient(FunctionalTestEnv.KafkaBrokerAddrs, config)
Expand Down