Skip to content

Conversation

@rpbritton
Copy link
Collaborator

@rpbritton rpbritton commented Oct 8, 2025

Description

Searching test results with execution metadata never returns. It takes too long.

My fix here is a refactor. I believe the previous solution was building a VERY large table in memory. This implementation is more in line with standard practices and performs quite a bit better with a large number of test executions and test results.

Resolved issues

Cannot use metadata on test results page.

Documentation

N/A

Web service API changes

N/A

Tests

Purely a refactor, all unit tests for attachment rules and test results search that depend on this logic still pass.

Tested locally using a restored dump of the production test observer database. Verified without the change that the page will not load, and with the change it does.

@rpbritton rpbritton requested review from Copilot and uyarahmet October 8, 2025 17:58
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 fixes a performance issue where searching test results with execution metadata never returns due to inefficient query construction. The fix refactors the filter_execution_metadata function to use a more efficient approach with EXISTS subqueries instead of building large in-memory tables.

  • Replaces complex values table and outer joins with simpler EXISTS subqueries for each metadata category
  • Removes unnecessary imports (func, values, column) and adds explicit join requirement
  • Improves query performance by avoiding large table construction in memory

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@rpbritton rpbritton merged commit 236c134 into main Oct 9, 2025
12 of 14 checks passed
@rpbritton rpbritton deleted the fix/search-test-results-with-execution-metadata branch October 9, 2025 12:25
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.

2 participants