Skip to content

Fix flaky SQL statistics test - #5769

Open
apurvabhaleMS wants to merge 2 commits into
mainfrom
personal/abhale/fix-flaky-stat-tests
Open

Fix flaky SQL statistics test#5769
apurvabhaleMS wants to merge 2 commits into
mainfrom
personal/abhale/fix-flaky-stat-tests

Conversation

@apurvabhaleMS

@apurvabhaleMS apurvabhaleMS commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes an intermittent failure in GivenMissingTrueSearchForPatientByGender_NotExistsStatsAreCreated.

The SQL search statistics cache is process-wide and may already contain valid individual-gender statistics for non-Patient resource types created by other test classes. The test now snapshots the cache before executing the Patient gender:missing=true search and scopes its negative assertion to newly added statistics. The positive assertion still verifies that the expected Patient statistic exists after the search.

Related issues

Addresses AB205695

Testing

Result: 1 passed, 0 failed.

FHIR Team Checklist

  • Update the title of the PR to be succinct and less than 65 characters
  • Add a milestone to the PR for the sprint that it is merged (i.e. add S47)
  • Tag the PR with the type of update: Bug, Build, Dependencies, Enhancement, New-Feature or Documentation
  • Tag the PR with Open source, Azure API for FHIR (CosmosDB or common code) or Azure Healthcare APIs (SQL or common code) to specify where this change is intended to be released.
  • Tag the PR with Schema Version backward compatible or Schema Version backward incompatible or Schema Version unchanged if this adds or updates Sql script which is/is not backward compatible with the code.
  • When changing or adding behavior, if your code modifies the system design or changes design assumptions, please create and include an ADR.
  • CI is green before merge Build Status
  • Review squash-merge requirements

Semver Change (docs)

Skip

@apurvabhaleMS
apurvabhaleMS requested a review from a team as a code owner August 28, 2026 14:34
@codecov-commenter

Codecov Comments Bot (codecov-commenter) commented Aug 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.81%. Comparing base (53e30b0) to head (d1433df).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #5769      +/-   ##
==========================================
+ Coverage   78.79%   78.81%   +0.02%     
==========================================
  Files        1020     1020              
  Lines       37783    37783              
  Branches     5754     5754              
==========================================
+ Hits        29772    29780       +8     
+ Misses       6594     6582      -12     
- Partials     1417     1421       +4     

see 6 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@apurvabhaleMS apurvabhaleMS added Enhancement-Test Enhancement on tests. Azure Healthcare APIs Label denotes that the issue or PR is relevant to the FHIR service in the Azure Healthcare APIs Schema Version unchanged No-ADR ADR not needed PaaS-breaking-change Add this label if your changes will require additional changes in PaaS repos to be complete No-PaaS-breaking-change labels Aug 28, 2026
@apurvabhaleMS apurvabhaleMS added this to the FY27\Q1\2wk\2wk05 milestone Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Azure Healthcare APIs Label denotes that the issue or PR is relevant to the FHIR service in the Azure Healthcare APIs Enhancement-Test Enhancement on tests. No-ADR ADR not needed No-PaaS-breaking-change PaaS-breaking-change Add this label if your changes will require additional changes in PaaS repos to be complete Schema Version unchanged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants