fix(test): strengthen retry guards in NetworkBaselineTest for external IPs#20046
Draft
fix(test): strengthen retry guards in NetworkBaselineTest for external IPs#20046
Conversation
Add a new column after "Profile(version)" that shows whether the profile is a regular "Profile" or a "Tailored Profile". The value is derived from the profile's OperatorKind enum stored in the database. UNSPECIFIED kind (should not occur in practice) renders as "Data Not Available" rather than defaulting to "Profile".
…l IPs The retry condition in "Verify network baseline functionality with multiple external entities" only checked that any peer was present (totalAnomalous + totalBaseline != 0). DNS flows (port 53) to IP1/IP2 arrive before the HTTP flow (port 80) to IP3, satisfying the guard early. The test then immediately asserts all 3 IPs are present, hitting a NPE when IP3 hasn't been baselined yet. Fix: replace the weak count check with per-IP assertions that all expected IPs are present in their respective lists (baseline or anomalous) before proceeding. Applied to both retry blocks in the test case. Partially generated by AI (claude-sonnet-4-6).
|
Skipping CI for Draft Pull Request. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #20046 +/- ##
==========================================
+ Coverage 49.56% 49.64% +0.07%
==========================================
Files 2764 2765 +1
Lines 208351 208817 +466
==========================================
+ Hits 103269 103666 +397
- Misses 97430 97489 +59
- Partials 7652 7662 +10
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
🚀 Build Images ReadyImages are ready for commit f97ace5. To use with deploy scripts: export MAIN_IMAGE_TAG=4.11.x-624-gf97ace5472 |
The collector no longer exposes the /state/runtime-config HTTP endpoint on port 8080. CollectorUtil.waitForConfigToHaveState() was port-forwarding to each collector pod and querying this endpoint to verify ConfigMap propagation, but always got 404, causing the 90-second retry loop to exhaust before failing with "IntrospectionQuery failed with Not Found". Remove waitForConfigToHaveState entirely and drop the now-unused imports (withRetry, protobuf, sensor.Collector). The ConfigMap write is preserved — the natural delay from pod startup and edge detection gives collectors enough time to pick up the new config. Partially generated by AI (claude-sonnet-4-6).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The test "Verify network baseline functionality with multiple external entities" in
NetworkBaselineTestwas flaky due to a race condition in its retry guards.Both
evaluateWithRetryblocks usedtotalAnomalous + totalBaseline != 0as the readiness condition — satisfied as soon as any peer appears. DNS flows (port 53) toEXTERNAL_IP1/EXTERNAL_IP2arrive before the HTTP flow (port 80) toEXTERNAL_IP3, causing the retry to exit early. The subsequentfind {}call forEXTERNAL_IP3returnednull, and.getPeer()on it caused aNullPointerException.Fix: replace the weak count check with explicit per-IP presence assertions in both retry blocks, so the retry only exits when all expected IPs are in their respective lists (baseline or anomalous).
User-facing documentation
Testing and quality
Automated testing
How I validated my change