Skip to content

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

// 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.

@sonarqubecloud
Copy link

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.

5 participants