Skip to content

ROX-30493: Add sensor readiness wait and cluster health checks#16689

Merged
janisz merged 7 commits intomasterfrom
fix-ROX-30493-admission-controller-sensor-timing
Sep 9, 2025
Merged

ROX-30493: Add sensor readiness wait and cluster health checks#16689
janisz merged 7 commits intomasterfrom
fix-ROX-30493-admission-controller-sensor-timing

Conversation

@janisz
Copy link
Contributor

@janisz janisz commented Sep 5, 2025

This change addresses timing issues between AdmissionControllerTest and ComplianceTest where sensor restarts caused test failures due to run ID mismatches.

Changes:

  • Use orchestrator.waitForSensor() after AdmissionControllerTest cleanup
  • Add cluster health validation in AdmissionControllerTest cleanup

🤖 Generated with Claude Code

This change addresses timing issues between AdmissionControllerTest and ComplianceTest
where sensor restarts caused test failures due to run ID mismatches.

Changes:
- Add orchestrator.waitForSensor() after AdmissionControllerTest cleanup
- Add cluster health validation in BaseSpecification.setupSpec()
- Ensure cluster is healthy before test execution begins

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Copy link
Member

@rukletsov rukletsov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see waitForSensor() calls advertised in the description but not in the code though. Am I missing anything?

Also, does asserting for health mean failing the test? If so, I think we need to wait for a reasonable time rather than fail.

@rhacs-bot
Copy link
Contributor

rhacs-bot commented Sep 5, 2025

Images are ready for the commit at 4c27fe3.

To use with deploy scripts, first export MAIN_IMAGE_TAG=4.9.x-655-g4c27fe330c.

@codecov
Copy link

codecov bot commented Sep 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 48.62%. Comparing base (34117b8) to head (4c27fe3).
⚠️ Report is 59 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #16689      +/-   ##
==========================================
- Coverage   48.73%   48.62%   -0.11%     
==========================================
  Files        2658     2664       +6     
  Lines      198307   199336    +1029     
==========================================
+ Hits        96635    96930     +295     
- Misses      94106    94813     +707     
- Partials     7566     7593      +27     
Flag Coverage Δ
go-unit-tests 48.62% <ø> (-0.11%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Signed-off-by: Tomasz Janiszewski <tomek@redhat.com>
@janisz janisz requested a review from rukletsov September 5, 2025 13:49
@janisz
Copy link
Contributor Author

janisz commented Sep 6, 2025

/retest

@red-hat-konflux
Copy link
Contributor

Caution

There are some errors in your PipelineRun template.

PipelineRun Error
central-db-on-push CEL expression evaluation error: expression "(\n event == \"push\" && target_branch.matches(\"^(master|release-.*|refs/tags/.*)$\")\n) || (\n event == \"pull_request\" && (\n target_branch.startsWith(\"release-\") ||\n source_branch.matches(\"(konflux|renovate|appstudio|rhtap)\") ||\n (has(body.pull_request.labels) && body.pull_request.labels.exists(l, l.name == \"konflux-build\"))\n ) && body.action != \"ready_for_review\"\n)\n" failed to evaluate: no such key: pull_request
main-on-push CEL expression evaluation error: expression "(\n event == \"push\" && target_branch.matches(\"^(master|release-.*|refs/tags/.*)$\")\n) || (\n event == \"pull_request\" && (\n target_branch.startsWith(\"release-\") ||\n source_branch.matches(\"(konflux|renovate|appstudio|rhtap)\") ||\n (has(body.pull_request.labels) && body.pull_request.labels.exists(l, l.name == \"konflux-build\"))\n ) && body.action != \"ready_for_review\"\n)\n" failed to evaluate: no such key: pull_request
operator-on-push CEL expression evaluation error: expression "(\n event == \"push\" && target_branch.matches(\"^(master|release-.*|refs/tags/.*)$\")\n) || (\n event == \"pull_request\" && (\n target_branch.startsWith(\"release-\") ||\n source_branch.matches(\"(konflux|renovate|appstudio|rhtap)\") ||\n (has(body.pull_request.labels) && body.pull_request.labels.exists(l, l.name == \"konflux-build\"))\n ) && body.action != \"ready_for_review\"\n)\n" failed to evaluate: no such key: pull_request
operator-bundle-on-push CEL expression evaluation error: expression "(\n event == \"push\" && target_branch.matches(\"^(master|release-.*|refs/tags/.*)$\")\n) || (\n event == \"pull_request\" && (\n target_branch.startsWith(\"release-\") ||\n source_branch.matches(\"(konflux|renovate|appstudio|rhtap)\") ||\n (has(body.pull_request.labels) && body.pull_request.labels.exists(l, l.name == \"konflux-build\"))\n ) && body.action != \"ready_for_review\"\n)\n" failed to evaluate: no such key: pull_request
retag-collector CEL expression evaluation error: expression "(\n event == \"push\" && target_branch.matches(\"^(master|release-.*|refs/tags/.*)$\")\n) || (\n event == \"pull_request\" && (\n target_branch.startsWith(\"release-\") ||\n source_branch.matches(\"(konflux|renovate|appstudio|rhtap)\") ||\n (has(body.pull_request.labels) && body.pull_request.labels.exists(l, l.name == \"konflux-build\"))\n ) && body.action != \"ready_for_review\"\n)\n" failed to evaluate: no such key: pull_request
retag-scanner-db-slim CEL expression evaluation error: expression "(\n event == \"push\" && target_branch.matches(\"^(master|release-.*|refs/tags/.*)$\")\n) || (\n event == \"pull_request\" && (\n target_branch.startsWith(\"release-\") ||\n source_branch.matches(\"(konflux|renovate|appstudio|rhtap)\") ||\n (has(body.pull_request.labels) && body.pull_request.labels.exists(l, l.name == \"konflux-build\"))\n ) && body.action != \"ready_for_review\"\n)\n" failed to evaluate: no such key: pull_request
retag-scanner-db CEL expression evaluation error: expression "(\n event == \"push\" && target_branch.matches(\"^(master|release-.*|refs/tags/.*)$\")\n) || (\n event == \"pull_request\" && (\n target_branch.startsWith(\"release-\") ||\n source_branch.matches(\"(konflux|renovate|appstudio|rhtap)\") ||\n (has(body.pull_request.labels) && body.pull_request.labels.exists(l, l.name == \"konflux-build\"))\n ) && body.action != \"ready_for_review\"\n)\n" failed to evaluate: no such key: pull_request
retag-scanner-slim CEL expression evaluation error: expression "(\n event == \"push\" && target_branch.matches(\"^(master|release-.*|refs/tags/.*)$\")\n) || (\n event == \"pull_request\" && (\n target_branch.startsWith(\"release-\") ||\n source_branch.matches(\"(konflux|renovate|appstudio|rhtap)\") ||\n (has(body.pull_request.labels) && body.pull_request.labels.exists(l, l.name == \"konflux-build\"))\n ) && body.action != \"ready_for_review\"\n)\n" failed to evaluate: no such key: pull_request
retag-scanner CEL expression evaluation error: expression "(\n event == \"push\" && target_branch.matches(\"^(master|release-.*|refs/tags/.*)$\")\n) || (\n event == \"pull_request\" && (\n target_branch.startsWith(\"release-\") ||\n source_branch.matches(\"(konflux|renovate|appstudio|rhtap)\") ||\n (has(body.pull_request.labels) && body.pull_request.labels.exists(l, l.name == \"konflux-build\"))\n ) && body.action != \"ready_for_review\"\n)\n" failed to evaluate: no such key: pull_request
roxctl-on-push CEL expression evaluation error: expression "(\n event == \"push\" && target_branch.matches(\"^(master|release-.*|refs/tags/.*)$\")\n) || (\n event == \"pull_request\" && (\n target_branch.startsWith(\"release-\") ||\n source_branch.matches(\"(konflux|renovate|appstudio|rhtap)\") ||\n (has(body.pull_request.labels) && body.pull_request.labels.exists(l, l.name == \"konflux-build\"))\n ) && body.action != \"ready_for_review\"\n)\n" failed to evaluate: no such key: pull_request
scanner-v4-on-push CEL expression evaluation error: expression "(\n event == \"push\" && target_branch.matches(\"^(master|release-.*|refs/tags/.*)$\")\n) || (\n event == \"pull_request\" && (\n target_branch.startsWith(\"release-\") ||\n source_branch.matches(\"(konflux|renovate|appstudio|rhtap)\") ||\n (has(body.pull_request.labels) && body.pull_request.labels.exists(l, l.name == \"konflux-build\"))\n ) && body.action != \"ready_for_review\"\n)\n" failed to evaluate: no such key: pull_request
scanner-v4-db-on-push CEL expression evaluation error: expression "(\n event == \"push\" && target_branch.matches(\"^(master|release-.*|refs/tags/.*)$\")\n) || (\n event == \"pull_request\" && (\n target_branch.startsWith(\"release-\") ||\n source_branch.matches(\"(konflux|renovate|appstudio|rhtap)\") ||\n (has(body.pull_request.labels) && body.pull_request.labels.exists(l, l.name == \"konflux-build\"))\n ) && body.action != \"ready_for_review\"\n)\n" failed to evaluate: no such key: pull_request

Signed-off-by: Tomasz Janiszewski <tomek@redhat.com>
@janisz janisz requested review from a team and mtodor September 8, 2025 07:50
Signed-off-by: Tomasz Janiszewski <tomek@redhat.com>
Signed-off-by: Tomasz Janiszewski <tomek@redhat.com>
@janisz janisz requested a review from mtodor September 8, 2025 11:57
@janisz janisz mentioned this pull request Sep 8, 2025
@janisz janisz requested a review from a team September 8, 2025 12:32
@janisz janisz merged commit d3afc34 into master Sep 9, 2025
89 checks passed
@janisz janisz deleted the fix-ROX-30493-admission-controller-sensor-timing branch September 9, 2025 08:50
ksurabhi91 pushed a commit that referenced this pull request Sep 11, 2025
Signed-off-by: Tomasz Janiszewski <tomek@redhat.com>
Co-authored-by: Claude <noreply@anthropic.com>
janisz added a commit that referenced this pull request Sep 23, 2025
…ation

Wait for collector to be healthy before checking collector->sensor network
edges in NetworkFlowTest. This prevents test failures caused by timing
issues where the test runs before collector has established proper
communication with the sensor.

- Add ApplicationHealth import to NetworkFlowTest
- Use waitForCollectorHealthiness() before edge verification
- Set 120-second timeout for collector health check
- Follows same pattern as PR #16689 for AdmissionControllerTest

This should resolve the flaky NetworkFlowTest failure where edges
return null due to collector not being ready.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants