Skip to content

feat: keep flakiness in table and user server-side pagination for flakiness overview#920

Open
meryemefe wants to merge 8 commits intostagingfrom
feat/flaky-test-optimization
Open

feat: keep flakiness in table and user server-side pagination for flakiness overview#920
meryemefe wants to merge 8 commits intostagingfrom
feat/flaky-test-optimization

Conversation

@meryemefe
Copy link
Contributor

@meryemefe meryemefe commented Mar 18, 2026

Motivation

After deploying Flakiness Overview feature to test environment, I realized that calculating flakiness score on the fly causes critical performance issue, even Java Heap Out of Memory error. Therefore, it is essential to keep flakiness score in the database and using server side pagination in flakiness overview implementation.

Description

  • Created test_case_flakiness table which keeps flakiness_score, default_branch_failure_rate, combined_failure_rate.
  • test_case_flakiness table is updated in TestResultProcessor after updating test_case_statistics.
  • Added pagination to getFlakyTestsOverview service, which returns results in pages and sorted by flakiness_score.
  • In the frontend, Flakiness Overview page is updated with new API call and made compatible with server-side pagination.
  • Flakiness computation process is optimized with map usage and bulk get queries on database.

Testing Instructions

Prerequisites:

  • Access to a Helios with at least one repository with tests with different flakiness scores.

Flow:

  1. Log in to Helios as a Developer
  2. Currently test_case_flakiness is empty. Run a test workflow to calculate flaky tests.
  3. Navigate to the Flakiness Overview page for a repository
  4. Verify:
    4.1. Table loads successfully.
    4.2. Search and severity filter still update the displayed page.
    4.3. Pagination controls behave consistently with server-side results.

Screenshots

Screenshot 2026-03-18 at 23 09 54

Checklist

General

Server

  • Code is performant and follows best practices
  • I documented the Java code using JavaDoc style.

Client

  • I documented the TypeScript code using JSDoc style.
  • I added multiple screenshots/screencasts of my UI changes.

@codacy-production
Copy link

codacy-production bot commented Mar 18, 2026

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
-0.15% (target: -1.00%) 62.83%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (437fcaa) 8387 2715 32.37%
Head commit (de80e11) 8445 (+58) 2721 (+6) 32.22% (-0.15%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#920) 191 120 62.83%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses performance issues in the Flakiness Overview by persisting flakiness metrics in a dedicated DB table and switching the overview endpoint + UI to server-side pagination/filtering/sorting.

Changes:

  • Add test_case_flakiness table + JPA entity/repository and recompute/update it after test statistics updates.
  • Update flaky tests overview endpoint/service to query the precomputed table with pagination + filters and return filteredCount.
  • Update Angular Flakiness Overview page to use lazy server-side pagination/filtering/sorting and align OpenAPI-generated client types.

Reviewed changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
server/application-server/src/main/resources/db/migration/V38__add_test_case_flakiness.sql Adds new table + index to persist flakiness metrics efficiently.
server/application-server/src/main/java/de/tum/cit/aet/helios/tests/TestCaseStatisticsService.java Implements flakiness persistence + paged overview query from the new table.
server/application-server/src/main/java/de/tum/cit/aet/helios/tests/TestResultProcessor.java Triggers recomputation/persistence after statistics updates.
server/application-server/src/main/java/de/tum/cit/aet/helios/tests/TestResultController.java Extends /api/tests/flaky with pagination/filter/search params.
server/application-server/src/main/java/de/tum/cit/aet/helios/tests/FlakyTestOverviewDto.java Adjusts DTO to match server-side paging (filteredCount) and new storage model.
server/application-server/openapi.yaml Documents new query params and updated response shape.
client/src/app/pages/flaky-tests-overview/* Moves Flakiness Overview table to server-side lazy loading and updates UI accordingly.
server/client tests & OpenAPI generated files Updates tests and generated client types for the API change.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@mertilginoglu
Copy link
Contributor

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fab952bb97

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@meryemefe meryemefe requested a review from mertilginoglu March 20, 2026 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants