Uploaded image for project: 'Xray for Jira'
  1. Xray for Jira
  2. XRAY-11750

Test Repository shows a negative Orphans count when Jira's search result limit is lower than the number of Tests in the project

    XporterXMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Unresolved
    • Xray DC 8.5.1
    • Xray DC 8.5.6
    • Test Repository
    • None
    • macOS 27.0

      Google Chrome Version 153.0.8010.53 (Official Build) (arm64)

    • UNCOVERED

    Description

      Description

      On Jira Data Center instances where the site dark feature com.atlassian.jira.lucene.search.limit.enabled is active, Jira caps any search requested as unlimited at the value of jira.search.platform.max.result.window.

      Xray calculates the Test Repository folder counts by querying all Tests of the project with an unlimited PagerFilter, so on projects with more Tests than the limit, the "All" count used in the Orphans calculation is truncated to the limit while the organized count is complete. The result is a negative Orphans count and an inflated organized count.

      For example: with the search limit set to 10,000, any project with more than 10,000 Tests on such an instance is expected to be affected.

      Example scenario (project with 50,000 Tests, 45,000 of them organized in folders):

      • Jira log during Test Repository load: "PagerFilter was requested as unlimited and has been capped at 10000 results, but the underlying query matched 50000 items. 40000 results were truncated."
      • Orphans = 10,000 (Jira capped) − 45,000 (organized) = −35,000
      • Correct Orphans = 50,000 − 45,000 = 5,000

      Pre-conditions

      • Jira DC with the site dark feature com.atlassian.jira.lucene.search.limit.enabled enabled and jira.search.platform.max.result.window set to a value lower than the number of Tests in a project
      • A project with more Tests than that limit, most of them organized in Test Repository folders

      How to reproduce

      1. On a Jira DC instance, enable the site dark feature com.atlassian.jira.lucene.search.limit.enabled and set jira.search.platform.max.result.window=10000 (Example) in jira-config.properties.
      2. In a project with more than 10,000 Tests, organize most of them into Test Repository folders so that the organized count is higher than 10,000.
      3. Open the project's Test Repository.
      4. Check the values of allTestsCount, allOrphanTestsCount, and the organized count shown in the UI.

       
      Actual result/Attachments 

      Based on Example above: 

      • allTestsCount: 50000
      • allOrphanTestsCount: -35000
      • Organized count shown in the UI: 85000
      • Jira log warning: "PagerFilter was requested as unlimited and has been capped at 10000 results, but the underlying query matched 50000 items. 40000 results were truncated."

      Expected result

      The Test Repository counts should be correct regardless of Jira's search result window: with 50,000 Tests and 45,000 organized, allOrphanTestsCount should be 5000 and the organized count 45000. Xray should not depend on an unlimited search to calculate these counts.

      Version

      • Xray for Jira Data Center 
      • Jira Data Center

      Workaround

      1. Raise jira.search.platform.max.result.window above the number of Tests in the largest
      2. Disable the site dark feature com.atlassian.jira.lucene.search.limit.enabled.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              joshua.tesfaye Joshua Tesfaye
              Votes:
              3 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: