Skip to content

OBSINTA-1006: Add UI performance benchmarks for Incidents page#873

Open
DavidRajnoha wants to merge 1 commit intoopenshift:mainfrom
DavidRajnoha:test/OBSINTA-1006-UI-load-tests
Open

OBSINTA-1006: Add UI performance benchmarks for Incidents page#873
DavidRajnoha wants to merge 1 commit intoopenshift:mainfrom
DavidRajnoha:test/OBSINTA-1006-UI-load-tests

Conversation

@DavidRajnoha
Copy link
Copy Markdown
Contributor

@DavidRajnoha DavidRajnoha commented Apr 10, 2026

Summary

Adds Cypress performance benchmarks that measure wall-clock render times for key Incidents page operations under escalating data loads, serving as regression indicators for future code changes.

New test specs

  • 01.performance_benchmark.cy.ts — Measures initial chart render times:

    • Incidents chart with 100 / 200 / 500 alerts (single incident)
    • Alerts detail chart after incident selection (100 / 200 / 500 alerts)
    • Multi-incident chart (20 uniform incidents)
    • Mixed-size incidents chart (12 heterogeneous incidents, 67 alerts)
  • 02.performance_walkthrough.cy.ts — Measures incremental re-render cost during interactive use:

    • Severity filter apply/clear cycles
    • Time range switching (1d → 3d → 7d → 15d → 1d)
    • Table row expansion with 100 and 500 alerts

New fixtures

  • 22-benchmark-20-incidents.yaml — 20 uniform single-alert incidents
  • 23-benchmark-mixed-size-incidents.yaml — 12 incidents with 1–15 alerts each

Threshold calibration

Thresholds were calibrated across 6 runs on 2 different CI clusters and set at 1.5x+ the worst observed value, rounded to a single significant digit. The Incidents page rendering is not on the critical performance path of the overall system, so the thresholds are intentionally generous — the goal is to catch significant regressions, not to enforce tight performance budgets.

Other changes

  • Documentation: docs/incident_detection/tests/performance/overview.md and 03.endurance_test_source.md

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Apr 10, 2026
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Apr 10, 2026

@DavidRajnoha: This pull request references OBSINTA-1006 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 10, 2026
@DavidRajnoha
Copy link
Copy Markdown
Contributor Author

/test e2e-incidents

@openshift-ci openshift-ci bot requested review from jgbernalp and zhuje April 10, 2026 08:34
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 10, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Adds Cypress performance test specs and fixtures for the Incidents page, a shelved endurance test source in docs, a small Cypress config change, and refactors incidents-page Cypress view helpers (signature and selector changes).

Changes

Cohort / File(s) Summary
Performance Test Documentation
docs/incident_detection/tests/performance/overview.md, docs/incident_detection/tests/performance/03.endurance_test_source.md
New overview describing benchmark, interactive walkthrough, and a shelved endurance strategy; includes preserved endurance test source and re-enable instructions.
Cypress Configuration
web/cypress.config.ts
Changed e2e.numTestsKeptInMemory from 10.
Performance Test Specs
web/cypress/e2e/incidents/performance/01.performance_benchmark.cy.ts, web/cypress/e2e/incidents/performance/02.performance_walkthrough.cy.ts
Added two Cypress specs that measure UI render timings via performance.mark/measure, record per-action benchmarks with thresholds, log results, and output aggregated summaries.
Endurance Test Source (shelved)
docs/.../03.endurance_test_source.md (re-enable writes web/cypress/e2e/incidents/performance/03.performance_endurance.cy.ts)
Shelved endurance select/deselect cycling test preserved in docs with full spec source and instructions to restore as a runnable spec.
Performance Test Fixtures
web/cypress/fixtures/incident-scenarios/22-benchmark-20-incidents.yaml, web/cypress/fixtures/incident-scenarios/23-benchmark-mixed-size-incidents.yaml
Added two YAML fixtures: a 20-incident scenario and a mixed-size incidents scenario supporting benchmark and walkthrough tests.
Incidents Page View Helpers
web/cypress/views/incidents-page.ts
Updated setDays (small waits, forced click); refactored selectIncidentById and deselectIncidentById to accept options?: { log?: boolean }, use direct CSS selectors for chart elements, and adjust alerts-table post-click existence assertions (function signatures changed).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (4)
web/cypress/views/incidents-page.ts (1)

364-378: Consider using the centralized element selector for the alerts table.

Both selectIncidentById and deselectIncidentById use a hardcoded selector string [data-test="incidents-alerts-table"] rather than the centralized incidentsTable element defined at line 116. This could lead to maintenance issues if the data-test ID changes.

♻️ Suggested refactor to use centralized selector
       .click({ force: true, log })
       .then(() => {
-        return cy.get(`[data-test="incidents-alerts-table"]`, { log })
+        return incidentsPage.elements.incidentsTable()
           .scrollIntoView({ log })
           .should('exist');
       });

Note: If the data-test IDs are intentionally different between incidentsTable and incidents-alerts-table, disregard this suggestion.

Also applies to: 387-400

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@web/cypress/views/incidents-page.ts` around lines 364 - 378, Replace the
hardcoded selector string `[data-test="incidents-alerts-table"]` in
selectIncidentById and deselectIncidentById with the centralized incidentsTable
element defined earlier (use the incidentsTable selector/variable from line 116)
so both functions reference the single source of truth; update the cy.get(...)
call chains in selectIncidentById and deselectIncidentById to use incidentsTable
(including the scrollIntoView and should('exist') steps) to avoid duplicate
hardcoded selectors.
web/cypress/e2e/incidents/performance/01.performance_benchmark.cy.ts (1)

148-148: Same suggestion as walkthrough test: document the 10-second waits.

Multiple cy.wait(10000) calls appear without explanation. A brief comment would clarify their purpose.

Also applies to: 200-200, 214-214

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@web/cypress/e2e/incidents/performance/01.performance_benchmark.cy.ts` at line
148, Three occurrences of cy.wait(10000) in 01.performance_benchmark.cy.ts are
undocumented; add brief comments explaining why each 10s hard wait is required
(e.g., waiting for background indexing, external service readiness, or UI
stabilization) so reviewers understand the intention. Locate the cy.wait(10000)
calls (around the current assertions/steps at the positions shown) and prepend a
one-line comment describing the specific reason and whether it can be replaced
by a conditional check (like cy.intercept/wait for a selector) in future.
web/cypress/e2e/incidents/performance/02.performance_walkthrough.cy.ts (2)

171-171: Consider adding a comment explaining the 10-second wait.

The cy.wait(10000) at the start of test 7.2 lacks explanation. If this is to allow teardown/GC from the previous test, a brief comment would help future maintainers understand the intent.

📝 Suggested documentation
   it('7.2 Walkthrough: Table row expansion with 100 and 500 alerts', () => {
+    // Allow browser/Cypress to stabilize after filter/time-range test before loading new fixtures
     cy.wait(10000);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@web/cypress/e2e/incidents/performance/02.performance_walkthrough.cy.ts` at
line 171, Add a brief inline comment above the cy.wait(10000) in
02.performance_walkthrough.cy.ts explaining why a 10s static wait is required
for test "7.2" (e.g., to allow previous-test teardown/GC or system warmup),
reference the exact statement `cy.wait(10000)`, and optionally add a TODO
suggesting replacing the hard wait with an explicit condition or stable selector
check in the future.

42-63: Consider extracting shared benchmark utilities.

The markStart and recordBenchmark helper functions are duplicated between this file and 01.performance_benchmark.cy.ts. Consider extracting them to a shared utility file to reduce duplication.

Also applies to: 52-63

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@web/cypress/e2e/incidents/performance/02.performance_walkthrough.cy.ts`
around lines 42 - 63, Extract the duplicated benchmarking helpers into a shared
utility: move benchmarkResults array plus the functions markStart(label) and
recordBenchmark(label, thresholdMs) into a new module (exporting the array and
both functions), update both spec files to import { benchmarkResults, markStart,
recordBenchmark } from that module, and ensure recordBenchmark still pushes into
the exported benchmarkResults and uses cy.window, cy.log, cy.task and the same
expect assertion; keep function names exactly markStart and recordBenchmark so
existing calls require minimal edits.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@web/cypress/e2e/incidents/performance/01.performance_benchmark.cy.ts`:
- Around line 199-211: Tests 6.3 and 6.4 call markStart before
cy.mockIncidentFixture, which causes the fixture load time to be included in the
benchmark and is inconsistent with benchmarkIncidentsChart (which marks start
after mocking); move the markStart call so it runs after
cy.mockIncidentFixture('incident-scenarios/22-benchmark-20-incidents.yaml') (and
similarly for the 40-incidents test) and before
incidentsPage.clearAllFilters()/elements assertions so the timing excludes
fixture loading and matches benchmarkIncidentsChart's pattern.

---

Nitpick comments:
In `@web/cypress/e2e/incidents/performance/01.performance_benchmark.cy.ts`:
- Line 148: Three occurrences of cy.wait(10000) in
01.performance_benchmark.cy.ts are undocumented; add brief comments explaining
why each 10s hard wait is required (e.g., waiting for background indexing,
external service readiness, or UI stabilization) so reviewers understand the
intention. Locate the cy.wait(10000) calls (around the current assertions/steps
at the positions shown) and prepend a one-line comment describing the specific
reason and whether it can be replaced by a conditional check (like
cy.intercept/wait for a selector) in future.

In `@web/cypress/e2e/incidents/performance/02.performance_walkthrough.cy.ts`:
- Line 171: Add a brief inline comment above the cy.wait(10000) in
02.performance_walkthrough.cy.ts explaining why a 10s static wait is required
for test "7.2" (e.g., to allow previous-test teardown/GC or system warmup),
reference the exact statement `cy.wait(10000)`, and optionally add a TODO
suggesting replacing the hard wait with an explicit condition or stable selector
check in the future.
- Around line 42-63: Extract the duplicated benchmarking helpers into a shared
utility: move benchmarkResults array plus the functions markStart(label) and
recordBenchmark(label, thresholdMs) into a new module (exporting the array and
both functions), update both spec files to import { benchmarkResults, markStart,
recordBenchmark } from that module, and ensure recordBenchmark still pushes into
the exported benchmarkResults and uses cy.window, cy.log, cy.task and the same
expect assertion; keep function names exactly markStart and recordBenchmark so
existing calls require minimal edits.

In `@web/cypress/views/incidents-page.ts`:
- Around line 364-378: Replace the hardcoded selector string
`[data-test="incidents-alerts-table"]` in selectIncidentById and
deselectIncidentById with the centralized incidentsTable element defined earlier
(use the incidentsTable selector/variable from line 116) so both functions
reference the single source of truth; update the cy.get(...) call chains in
selectIncidentById and deselectIncidentById to use incidentsTable (including the
scrollIntoView and should('exist') steps) to avoid duplicate hardcoded
selectors.
🪄 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: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 289c9c99-bf13-4161-9c8e-d4e95a9c1919

📥 Commits

Reviewing files that changed from the base of the PR and between bf53ceb and 7e5f573.

📒 Files selected for processing (8)
  • docs/incident_detection/tests/performance/03.endurance_test_source.md
  • docs/incident_detection/tests/performance/overview.md
  • web/cypress.config.ts
  • web/cypress/e2e/incidents/performance/01.performance_benchmark.cy.ts
  • web/cypress/e2e/incidents/performance/02.performance_walkthrough.cy.ts
  • web/cypress/fixtures/incident-scenarios/22-benchmark-20-incidents.yaml
  • web/cypress/fixtures/incident-scenarios/23-benchmark-mixed-size-incidents.yaml
  • web/cypress/views/incidents-page.ts

Comment thread web/cypress/e2e/incidents/performance/01.performance_benchmark.cy.ts Outdated
@DavidRajnoha DavidRajnoha force-pushed the test/OBSINTA-1006-UI-load-tests branch from 7e5f573 to a341bf9 Compare April 10, 2026 08:41
@openshift-ci openshift-ci bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 10, 2026
@DavidRajnoha
Copy link
Copy Markdown
Contributor Author

/test e2e-incidents

@DavidRajnoha
Copy link
Copy Markdown
Contributor Author

/hold

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 10, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@web/cypress/views/incidents-page.ts`:
- Around line 415-420: The selector currently uses substring matching in the
cy.get call that targets `[data-test="incidents-chart-bars"]
g[data-test*="${incidentId}"]`, which can match unintended IDs; update the
selector to target the exact bar suffix (the `data-test` follows
`incidents-chart-bar-{group_id}`) by using an ends-with selector or full exact
match for the `g[data-test]` part (e.g., change `g[data-test*="${incidentId}"]`
to `g[data-test$="-${incidentId}"]` or
`g[data-test="incidents-chart-bar-${incidentId}"]`) so the correct incident bar
is selected without relying on `.first()`; keep the rest of the chain (.first(),
.click()) as needed.
- Around line 438-443: The selector is using a substring match
([data-test*="${incidentId}"]) which can match unintended elements; update the
selector to use an ends-with match like `[data-test$="-${incidentId}"]` (same
approach used in selectIncidentById) for the query targeting
`[data-test="incidents-chart-bars"] g ... path[role="presentation"]`, then keep
the chained .first().click({ force: true, log }) behavior unchanged so the test
consistently targets the correct incident chart bar.
🪄 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: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 848fc785-59e6-4286-a7ce-f5cf7499fb6c

📥 Commits

Reviewing files that changed from the base of the PR and between 7e5f573 and a341bf9.

📒 Files selected for processing (8)
  • docs/incident_detection/tests/performance/03.endurance_test_source.md
  • docs/incident_detection/tests/performance/overview.md
  • web/cypress.config.ts
  • web/cypress/e2e/incidents/performance/01.performance_benchmark.cy.ts
  • web/cypress/e2e/incidents/performance/02.performance_walkthrough.cy.ts
  • web/cypress/fixtures/incident-scenarios/22-benchmark-20-incidents.yaml
  • web/cypress/fixtures/incident-scenarios/23-benchmark-mixed-size-incidents.yaml
  • web/cypress/views/incidents-page.ts
✅ Files skipped from review due to trivial changes (4)
  • web/cypress.config.ts
  • web/cypress/fixtures/incident-scenarios/23-benchmark-mixed-size-incidents.yaml
  • docs/incident_detection/tests/performance/03.endurance_test_source.md
  • docs/incident_detection/tests/performance/overview.md
🚧 Files skipped from review as they are similar to previous changes (3)
  • web/cypress/e2e/incidents/performance/01.performance_benchmark.cy.ts
  • web/cypress/fixtures/incident-scenarios/22-benchmark-20-incidents.yaml
  • web/cypress/e2e/incidents/performance/02.performance_walkthrough.cy.ts

Comment thread web/cypress/views/incidents-page.ts Outdated
Comment thread web/cypress/views/incidents-page.ts Outdated
@DavidRajnoha DavidRajnoha force-pushed the test/OBSINTA-1006-UI-load-tests branch from a341bf9 to a48a1b9 Compare April 10, 2026 12:12
@DavidRajnoha
Copy link
Copy Markdown
Contributor Author

/test e2e-incidents

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
web/cypress/views/incidents-page.ts (1)

206-209: Avoid hard sleeps in this shared helper.

These two cy.wait(250) calls add a fixed 500 ms to every setDays() call and make the new performance specs measure helper delays instead of UI readiness. Prefer waiting on the dropdown state only.

Suggested change
   setDays: (value: '1 day' | '3 days' | '7 days' | '15 days') => {
     cy.log('incidentsPage.setDays');
-    cy.wait(250);
-    incidentsPage.elements.daysSelectToggle().scrollIntoView().click({ force: true });
+    incidentsPage.elements.daysSelectToggle().should('be.visible').scrollIntoView().click({ force: true });
     incidentsPage.elements.daysSelectList().should('be.visible');
-    cy.wait(250);
     const dayKey = value.replace(' ', '-');
     cy.byTestID(`${DataTestIDs.IncidentsPage.DaysSelectOption}-${dayKey}`)
       .should('be.visible')
       .click();

As per coding guidelines, "Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@web/cypress/views/incidents-page.ts` around lines 206 - 209, The two fixed
sleeps in the setDays helper should be removed and replaced with UI-driven
waits: remove both cy.wait(250) calls and rely on
incidentsPage.elements.daysSelectToggle().scrollIntoView().click({ force: true
}) followed immediately by
incidentsPage.elements.daysSelectList().should('be.visible') (and, after
selecting an option, assert the list is hidden or the selection is applied as
needed). Update the setDays helper to wait only on
incidentsPage.elements.daysSelectList() visibility (and subsequent expected
state) instead of using fixed delays so tests wait for UI readiness rather than
arbitrary time.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@web/cypress/views/incidents-page.ts`:
- Around line 412-417: Change the default logging behavior for the incident
selectors to avoid Cypress logging overhead in perf tests: update
selectIncidentById and deselectIncidentById so their options default log to
false (const log = options?.log ?? false) instead of true; this preserves opt-in
logging for individual calls while allowing existing performance tests to call
the helpers without incurring log overhead (alternatively, if you prefer not to
change defaults, update the perf specs to call selectIncidentById(id, { log:
false }) and deselectIncidentById(id, { log: false })).

---

Nitpick comments:
In `@web/cypress/views/incidents-page.ts`:
- Around line 206-209: The two fixed sleeps in the setDays helper should be
removed and replaced with UI-driven waits: remove both cy.wait(250) calls and
rely on incidentsPage.elements.daysSelectToggle().scrollIntoView().click({
force: true }) followed immediately by
incidentsPage.elements.daysSelectList().should('be.visible') (and, after
selecting an option, assert the list is hidden or the selection is applied as
needed). Update the setDays helper to wait only on
incidentsPage.elements.daysSelectList() visibility (and subsequent expected
state) instead of using fixed delays so tests wait for UI readiness rather than
arbitrary time.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 61ab497a-0d5e-4f69-8e19-988829258895

📥 Commits

Reviewing files that changed from the base of the PR and between a341bf9 and a48a1b9.

📒 Files selected for processing (4)
  • docs/incident_detection/tests/performance/03.endurance_test_source.md
  • docs/incident_detection/tests/performance/overview.md
  • web/cypress/e2e/incidents/performance/01.performance_benchmark.cy.ts
  • web/cypress/views/incidents-page.ts
✅ Files skipped from review due to trivial changes (3)
  • web/cypress/e2e/incidents/performance/01.performance_benchmark.cy.ts
  • docs/incident_detection/tests/performance/overview.md
  • docs/incident_detection/tests/performance/03.endurance_test_source.md

Comment thread web/cypress/views/incidents-page.ts Outdated
Comment on lines +412 to +417
selectIncidentById: (incidentId: string, options?: { log?: boolean }) => {
const log = options?.log ?? true;
if (log) cy.log(`incidentsPage.selectIncidentById: ${incidentId}`);
return cy.get(
`[data-test="incidents-chart-bars"] g[data-test$="-${incidentId}"] path[role="presentation"]`,
{ log },
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

The new log option does not help the benchmark path with a true default.

selectIncidentById() and deselectIncidentById() now accept { log?: boolean }, but both default to true. The current performance callers still invoke selectIncidentById(incidentId) without options (web/cypress/e2e/incidents/performance/01.performance_benchmark.cy.ts:164-169, web/cypress/e2e/incidents/performance/02.performance_walkthrough.cy.ts:177-181), so the benchmark path keeps full Cypress command logging overhead. Either flip the default to false here or update the perf specs to pass { log: false }.

Suggested change
   selectIncidentById: (incidentId: string, options?: { log?: boolean }) => {
-    const log = options?.log ?? true;
+    const log = options?.log ?? false;
     if (log) cy.log(`incidentsPage.selectIncidentById: ${incidentId}`);
   deselectIncidentById: (incidentId: string, options?: { log?: boolean }) => {
-    const log = options?.log ?? true;
+    const log = options?.log ?? false;
     if (log) cy.log(`incidentsPage.deselectIncidentById: ${incidentId}`);

As per coding guidelines, "Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity."

Also applies to: 435-440

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@web/cypress/views/incidents-page.ts` around lines 412 - 417, Change the
default logging behavior for the incident selectors to avoid Cypress logging
overhead in perf tests: update selectIncidentById and deselectIncidentById so
their options default log to false (const log = options?.log ?? false) instead
of true; this preserves opt-in logging for individual calls while allowing
existing performance tests to call the helpers without incurring log overhead
(alternatively, if you prefer not to change defaults, update the perf specs to
call selectIncidentById(id, { log: false }) and deselectIncidentById(id, { log:
false })).

@DavidRajnoha
Copy link
Copy Markdown
Contributor Author

/test e2e-incidents

2 similar comments
@DavidRajnoha
Copy link
Copy Markdown
Contributor Author

/test e2e-incidents

@DavidRajnoha
Copy link
Copy Markdown
Contributor Author

/test e2e-incidents

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@web/cypress/e2e/incidents/performance/01.performance_benchmark.cy.ts`:
- Around line 73-79: The PASS/FAIL check treats exact-threshold runs as FAIL;
update the comparison to allow equality by changing the status logic to use
elapsedMs <= thresholdMs (reference: status, elapsedMs, thresholdMs) and change
the assertion to use a "at most" check (e.g., expect(elapsedMs, `${label} should
complete within ${thresholdMs}ms`).to.be.at.most(thresholdMs)) so runs equal to
the threshold pass while preserving cy.log/msg behavior.
🪄 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: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: f035924c-d507-429e-9c5d-48aa85372531

📥 Commits

Reviewing files that changed from the base of the PR and between a48a1b9 and 7147d6e.

📒 Files selected for processing (2)
  • web/cypress/e2e/incidents/performance/01.performance_benchmark.cy.ts
  • web/cypress/e2e/incidents/performance/02.performance_walkthrough.cy.ts
✅ Files skipped from review due to trivial changes (1)
  • web/cypress/e2e/incidents/performance/02.performance_walkthrough.cy.ts

Comment thread web/cypress/e2e/incidents/performance/01.performance_benchmark.cy.ts Outdated
@DavidRajnoha DavidRajnoha force-pushed the test/OBSINTA-1006-UI-load-tests branch 2 times, most recently from dbaf6dc to b96e6a1 Compare April 13, 2026 09:23
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
web/cypress/views/incidents-page.ts (1)

412-417: ⚠️ Potential issue | 🟠 Major

Make logging opt-in on the ID select/deselect hot path.

Line 413 and Line 436 still default log to true, so these helpers keep full Cypress command-log overhead unless every benchmark caller passes { log: false }. Either flip the default here or verify that all performance specs opt out explicitly.

Suggested change
   selectIncidentById: (incidentId: string, options?: { log?: boolean }) => {
-    const log = options?.log ?? true;
+    const log = options?.log ?? false;
     if (log) cy.log(`incidentsPage.selectIncidentById: ${incidentId}`);
   deselectIncidentById: (incidentId: string, options?: { log?: boolean }) => {
-    const log = options?.log ?? true;
+    const log = options?.log ?? false;
     if (log) cy.log(`incidentsPage.deselectIncidentById: ${incidentId}`);

Run this to inspect the perf call sites:

#!/bin/bash
set -euo pipefail

if [ -d web/cypress/e2e/incidents/performance ]; then
  rg -n -C2 '\bselectIncidentById\s*\(|\bdeselectIncidentById\s*\(' web/cypress/e2e/incidents/performance
fi

Expected: benchmark/endurance call sites either pass { log: false } or these helpers default to false.

As per coding guidelines, "Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity."

Also applies to: 435-440

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@web/cypress/views/incidents-page.ts` around lines 412 - 417, The
selectIncidentById and deselectIncidentById helpers default the Cypress { log }
option to true which forces heavy command logging on the hot path; change the
default to false (e.g., const log = options?.log ?? false) so callers opt into
logging, and audit performance test call sites to ensure no regressions (ensure
any benchmark/endurance specs explicitly pass { log: true } if they need logs).
🧹 Nitpick comments (1)
web/cypress/views/incidents-page.ts (1)

206-209: Avoid fixed sleeps in setDays().

Line 206 and Line 209 add 500ms of unconditional delay to every call. In a shared helper that the new perf flows can hit, that makes timings noisier and the suite slower; the existing visibility assertions should be the sync point instead.

Suggested change
   setDays: (value: '1 day' | '3 days' | '7 days' | '15 days') => {
     cy.log('incidentsPage.setDays');
-    cy.wait(250);
     incidentsPage.elements.daysSelectToggle().scrollIntoView().click({ force: true });
     incidentsPage.elements.daysSelectList().should('be.visible');
-    cy.wait(250);
     const dayKey = value.replace(' ', '-');

As per coding guidelines, "Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@web/cypress/views/incidents-page.ts` around lines 206 - 209, The two
unconditional cy.wait(250) calls around the dropdown interaction in setDays()
should be removed; rely on the existing sync assertions instead by removing the
wait before clicking incidentsPage.elements.daysSelectToggle() and the wait
after incidentsPage.elements.daysSelectList().should('be.visible'), and ensure
you assert visibility (daysSelectList().should('be.visible')) before proceeding
to any actions that depend on the list being open (using
incidentsPage.elements.daysSelectToggle() and daysSelectList() as the unique
selectors to locate the code to change).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@web/cypress/views/incidents-page.ts`:
- Around line 412-417: The selectIncidentById and deselectIncidentById helpers
default the Cypress { log } option to true which forces heavy command logging on
the hot path; change the default to false (e.g., const log = options?.log ??
false) so callers opt into logging, and audit performance test call sites to
ensure no regressions (ensure any benchmark/endurance specs explicitly pass {
log: true } if they need logs).

---

Nitpick comments:
In `@web/cypress/views/incidents-page.ts`:
- Around line 206-209: The two unconditional cy.wait(250) calls around the
dropdown interaction in setDays() should be removed; rely on the existing sync
assertions instead by removing the wait before clicking
incidentsPage.elements.daysSelectToggle() and the wait after
incidentsPage.elements.daysSelectList().should('be.visible'), and ensure you
assert visibility (daysSelectList().should('be.visible')) before proceeding to
any actions that depend on the list being open (using
incidentsPage.elements.daysSelectToggle() and daysSelectList() as the unique
selectors to locate the code to change).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: f16d92e5-e85c-430f-8f99-5c95cb5bf851

📥 Commits

Reviewing files that changed from the base of the PR and between 7147d6e and dbaf6dc.

📒 Files selected for processing (8)
  • docs/incident_detection/tests/performance/03.endurance_test_source.md
  • docs/incident_detection/tests/performance/overview.md
  • web/cypress.config.ts
  • web/cypress/e2e/incidents/performance/01.performance_benchmark.cy.ts
  • web/cypress/e2e/incidents/performance/02.performance_walkthrough.cy.ts
  • web/cypress/fixtures/incident-scenarios/22-benchmark-20-incidents.yaml
  • web/cypress/fixtures/incident-scenarios/23-benchmark-mixed-size-incidents.yaml
  • web/cypress/views/incidents-page.ts
✅ Files skipped from review due to trivial changes (6)
  • web/cypress.config.ts
  • web/cypress/fixtures/incident-scenarios/23-benchmark-mixed-size-incidents.yaml
  • web/cypress/e2e/incidents/performance/01.performance_benchmark.cy.ts
  • docs/incident_detection/tests/performance/03.endurance_test_source.md
  • web/cypress/fixtures/incident-scenarios/22-benchmark-20-incidents.yaml
  • docs/incident_detection/tests/performance/overview.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • web/cypress/e2e/incidents/performance/02.performance_walkthrough.cy.ts

@DavidRajnoha DavidRajnoha force-pushed the test/OBSINTA-1006-UI-load-tests branch 2 times, most recently from c91ba4c to 449af96 Compare April 13, 2026 09:58
…OBSINTA-1006)

Add Cypress performance benchmarks measuring wall-clock render times for
incidents chart, alerts detail chart, filter interactions, time range
switching, and table row expansion under escalating data loads (100-500
alerts, 12-20 incidents). Thresholds calibrated at 1.5x+ worst observed
values across two CI clusters for stable pass rates.

- 01.performance_benchmark: chart render benchmarks with escalating loads
- 02.performance_walkthrough: interactive filter/time-range/table benchmarks
- Fixtures: 20 uniform incidents, 12 mixed-size heterogeneous incidents
- Revert selectIncidentById/deselectIncidentById to main (optimized
  selectors showed no measurable advantage across 6 benchmark runs)
- Documentation: performance test overview and endurance test source

Made-with: Cursor
@DavidRajnoha DavidRajnoha force-pushed the test/OBSINTA-1006-UI-load-tests branch from 76cede7 to f1c6df9 Compare April 15, 2026 12:43
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 15, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: DavidRajnoha
Once this PR has been reviewed and has the lgtm label, please assign jgbernalp for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@DavidRajnoha DavidRajnoha changed the title OBSINTA-1006: UI load tests OBSINTA-1006: Add UI performance benchmarks for Incidents page Apr 15, 2026
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Apr 15, 2026

@DavidRajnoha: This pull request references OBSINTA-1006 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Summary

Adds Cypress performance benchmarks that measure wall-clock render times for key Incidents page operations under escalating data loads, serving as regression indicators for future code changes.

New test specs

  • 01.performance_benchmark.cy.ts — Measures initial chart render times:

  • Incidents chart with 100 / 200 / 500 alerts (single incident)

  • Alerts detail chart after incident selection (100 / 200 / 500 alerts)

  • Multi-incident chart (20 uniform incidents)

  • Mixed-size incidents chart (12 heterogeneous incidents, 67 alerts)

  • 02.performance_walkthrough.cy.ts — Measures incremental re-render cost during interactive use:

  • Severity filter apply/clear cycles

  • Time range switching (1d → 3d → 7d → 15d → 1d)

  • Table row expansion with 100 and 500 alerts

New fixtures

  • 22-benchmark-20-incidents.yaml — 20 uniform single-alert incidents
  • 23-benchmark-mixed-size-incidents.yaml — 12 incidents with 1–15 alerts each

Threshold calibration

Thresholds were calibrated across 6 runs on 2 different CI clusters and set at 1.5x+ the worst observed value, rounded to a single significant digit. The Incidents page rendering is not on the critical performance path of the overall system, so the thresholds are intentionally generous — the goal is to catch significant regressions, not to enforce tight performance budgets.

Other changes

  • Documentation: docs/incident_detection/tests/performance/overview.md and 03.endurance_test_source.md

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 15, 2026

@DavidRajnoha: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-incidents a48a1b9 link false /test e2e-incidents
ci/prow/e2e-aws-ovn f1c6df9 link true /test e2e-aws-ovn

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants