Fixes to backend tests#2778
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
📝 WalkthroughWalkthroughThis PR updates integration tests to migrate TLS tracking from ChangesIntegration Test Updates
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@integration-tests/backend/test_flowcollector.go`:
- Line 2730: The test currently hard-codes an expectation that
r.Flowlog.TLSGroup contains "X25519", which is environment-dependent and flaky;
change the assertion in integration-tests/backend/test_flowcollector.go that
references r.Flowlog.TLSGroup (the
Expect(...).Should(ContainSubstring("X25519")) line) to instead assert a
non-empty value or membership in a small allowed set (e.g., check that
r.Flowlog.TLSGroup != "" or that it is one of ["X25519","secp256r1","secp384r1"]
using Expect(...).ShouldNot(o.BeEmpty()) or
Expect(allowedSet).To(ContainElement(r.Flowlog.TLSGroup))). Ensure you update
only that assertion so tests become environment-agnostic.
In `@integration-tests/backend/test_flowcollectorslice.go`:
- Around line 405-407: The test treats the `timeout 300 ping ...` exit status as
a failure (calling e2eoutput.RunHostCmd and then
Expect(err).NotTo(o.HaveOccurred())), but timeout intentionally exits non‑zero
when it stops pinging; update the RunHostCmd invocation to tolerate the non‑zero
exit by appending "|| true" (e.g., run "bash -c 'timeout 300 ping <ip> ||
true'") or otherwise ignore the timeout-induced exit code, and keep the Expect
check only for real execution errors rather than the timeout exit.
In `@integration-tests/backend/testdata/kafka/kafka-default.yaml`:
- Around line 48-49: The file sets metadataVersion: 4.0-IV3 while version:
4.1.0, which causes UnsupportedVersionException; update the metadataVersion to
match Kafka 4.1.x or remove the metadataVersion field so Strimzi will default to
the correct metadata for the declared cluster version (change the
metadataVersion entry or delete it near the existing metadataVersion and version
keys).
In `@integration-tests/backend/testdata/kafka/kafka-tls.yaml`:
- Around line 52-53: The metadataVersion currently set to "metadataVersion:
4.0-IV3" is incompatible with Kafka "version: 4.1.0"; update the metadataVersion
field in the kafka-tls.yaml (the metadataVersion key) to a 4.1 level such as
"4.1-IV1" or remove the metadataVersion line to let Strimzi choose the correct
default so inter-broker communication uses the proper metadata protocol for
Kafka 4.1.0.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 97f05324-c3d8-42bc-a9fe-907953176d71
📒 Files selected for processing (10)
integration-tests/backend/flowcollector.gointegration-tests/backend/metrics.gointegration-tests/backend/test_flowcollector.gointegration-tests/backend/test_flowcollectorslice.gointegration-tests/backend/testdata/kafka/kafka-default.yamlintegration-tests/backend/testdata/kafka/kafka-node-pool.yamlintegration-tests/backend/testdata/kafka/kafka-tls.yamlintegration-tests/backend/testdata/kafka/kafka-topic.yamlintegration-tests/backend/testdata/kafka/kafka-user.yamlintegration-tests/backend/testdata/subscription/image-digest-mirror-set.yaml
There was a problem hiding this comment.
♻️ Duplicate comments (1)
integration-tests/backend/test_flowcollectorslice.go (1)
405-407:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winDon’t suppress traffic-generation execution errors.
Line 406 currently drops all command failures. That can hide real
exec/pingfailures and make this scenario pass without guaranteed traffic.Suggested fix
- // Continuously ping server for 300 seconds to generate sustained traffic - _, _ = e2eoutput.RunHostCmd(testPingPodsTemplate.ClientNS, "ping-client", "timeout 300 ping "+serverPodIP) + // Continuously ping server for 300 seconds to generate sustained traffic + _, err = e2eoutput.RunHostCmd(testPingPodsTemplate.ClientNS, "ping-client", "ping -w 300 "+serverPodIP) + o.Expect(err).NotTo(o.HaveOccurred()) time.Sleep(60 * time.Second)🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@integration-tests/backend/test_flowcollectorslice.go` around lines 405 - 407, Do not discard the RunHostCmd result: replace the ignored return with capturing both output and error from e2eoutput.RunHostCmd(testPingPodsTemplate.ClientNS, "ping-client", "timeout 300 ping "+serverPodIP) and fail the test on error (e.g., t.Fatalf or equivalent) while including both the error and command output in the message so real exec/ping failures are visible; keep the subsequent time.Sleep(60 * time.Second).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Duplicate comments:
In `@integration-tests/backend/test_flowcollectorslice.go`:
- Around line 405-407: Do not discard the RunHostCmd result: replace the ignored
return with capturing both output and error from
e2eoutput.RunHostCmd(testPingPodsTemplate.ClientNS, "ping-client", "timeout 300
ping "+serverPodIP) and fail the test on error (e.g., t.Fatalf or equivalent)
while including both the error and command output in the message so real
exec/ping failures are visible; keep the subsequent time.Sleep(60 *
time.Second).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 8dd3af5f-df7b-4d51-9fe4-cadc9cf16caa
📒 Files selected for processing (10)
integration-tests/backend/flowcollector.gointegration-tests/backend/metrics.gointegration-tests/backend/test_flowcollector.gointegration-tests/backend/test_flowcollectorslice.gointegration-tests/backend/testdata/kafka/kafka-default.yamlintegration-tests/backend/testdata/kafka/kafka-node-pool.yamlintegration-tests/backend/testdata/kafka/kafka-tls.yamlintegration-tests/backend/testdata/kafka/kafka-topic.yamlintegration-tests/backend/testdata/kafka/kafka-user.yamlintegration-tests/backend/testdata/subscription/image-digest-mirror-set.yaml
✅ Files skipped from review due to trivial changes (2)
- integration-tests/backend/testdata/kafka/kafka-node-pool.yaml
- integration-tests/backend/testdata/kafka/kafka-user.yaml
Description
PR changes:
Dependencies
n/a
Test Results
[sig-netobserv] Network_Observability with Loki with Kafka Author:aramesha-NonPreRelease-Longduration-Critical-56362-High-53597-High-56326-High-64880-High-75340-Verify network flows are captured with Kafka
with TLS [Serial][Slow]
• PASSED [783.614 seconds]
[sig-netobserv] Network_Observability with Loki with Kafka Author:aramesha-NonPreRelease-Longduration-High-57397-High-65116-Verify network-flows export with Kafka and netobserv installation without
Loki[Serial]
• PASSED [869.841 seconds]
[sig-netobserv] Network_Observability Author:aramesha-Critical-86388-Verify flowCollectorSlice collectionMode: AlwaysCollect [Serial]
• PASSED [663.264 seconds]
[sig-netobserv] Network_Observability Author:aramesha-Critical-86388-Verify flowCollectorSlice collectionMode: AllowList [Serial]
• PASSED [1047.535 seconds]
[sig-netobserv] Network_Observability with Loki Author:aramesha-NonPreRelease-High-88455-Verify TLS Tracking feature [Serial]
• PASSED [821.818 seconds]
Checklist
Summary by CodeRabbit
New Features
Tests
Chores