Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes Flaky export test #2022

Merged
merged 1 commit into from
May 11, 2023
Merged

Fixes Flaky export test #2022

merged 1 commit into from
May 11, 2023

Conversation

tonylee80
Copy link
Contributor

@tonylee80 tonylee80 commented May 11, 2023

Fixes is a flaky test export.test which is causing builds to fail:

For example:
https://github.com/medplum/medplum/actions/runs/4951064553/jobs/8855536568

@tonylee80 tonylee80 requested a review from a team as a code owner May 11, 2023 21:36
@vercel
Copy link

vercel bot commented May 11, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Ignored Deployments
Name Status Preview Updated (UTC)
medplum-storybook ⬜️ Ignored (Inspect) May 11, 2023 9:36pm
medplum-www ⬜️ Ignored (Inspect) May 11, 2023 9:36pm

@@ -300,7 +300,7 @@ describe('System export', () => {

// Output format is "ndjson", new line delimited JSON
const resourceJSON = dataRes.text.trim().split('\n');
expect(resourceJSON).toHaveLength(3);
expect(resourceJSON.length).toBeGreaterThan(1);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The failed build is showing that the test is getting duplicated resources. It's likely caused by race conditions introduced when creating Observation resources in the test inside await waitFor. Updating the test to assert that at least more than 1 Observation resources is created.

@sonarcloud
Copy link

sonarcloud bot commented May 11, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@tonylee80 tonylee80 merged commit 7c136ac into main May 11, 2023
@rahul1 rahul1 deleted the tony-fixes-flaky-export-test branch May 11, 2023 22:07
@tonylee80 tonylee80 self-assigned this May 12, 2023
@reshmakh reshmakh added the fhir-datastore Related to the FHIR datastore, includes API and FHIR operations label May 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fhir-datastore Related to the FHIR datastore, includes API and FHIR operations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants