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

Fix broken tests #1111

Merged
merged 5 commits into from
Feb 24, 2025
Merged

Fix broken tests #1111

merged 5 commits into from
Feb 24, 2025

Conversation

barmac
Copy link
Member

@barmac barmac commented Feb 21, 2025

Proposed Changes

This fixes some tests which used to throw uncaught promise exceptions.

I propose also to stop testing for the edited dot existence. These assertions are super flaky and slow (wait 50 ms included), and a rewrite to waitFor did not resolve flakiness on my machine. I don't think this is a crucial feature, and we tested for it only in some places in the code base.

Checklist

To ensure you provided everything we need to look at your PR:

  • Brief textual description of the changes present
  • Visual demo attached
  • Steps to try out present, i.e. using the @bpmn-io/sr tool
  • Related issue linked via Closes {LINK_TO_ISSUE} or Related to {LINK_TO_ISSUE}

@bpmn-io-tasks bpmn-io-tasks bot added the in progress Currently worked on label Feb 21, 2025
Required because we don't display `input` for expression editor.
@barmac barmac marked this pull request as ready for review February 21, 2025 14:41
@bpmn-io-tasks bpmn-io-tasks bot added needs review Review pending and removed in progress Currently worked on labels Feb 21, 2025
@@ -78,7 +78,7 @@ describe('provider/bpmn - EscalationProps', function() {
elementRegistry.get('EscalationIntermediateEvent_1')
];

escalationElements.forEach(async (element) => {
for (const element of escalationElements) {
Copy link
Member

Choose a reason for hiding this comment

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

🤣


async function expectEdited(container, exists) {

await wait(50);
Copy link
Member

Choose a reason for hiding this comment

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

Why would the waitFor utility from testing-library not work here, and keeping the test?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't know but it failed even after rewrite. I can try again today.

Copy link
Member Author

Choose a reason for hiding this comment

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

So this is how it looks with waitFor, but it fails on MacOS in chromeheadless: 9abdfdb
It works in .only though.

Copy link
Member Author

Choose a reason for hiding this comment

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

I checked how the test suite behaves with different test suites, and it is green when I run only provider tests, but starts to fail when everything is included. Perhaps it's a slow clean up that jams on a local machine?

Copy link
Member

Choose a reason for hiding this comment

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

My advice would be: Let's keep this test. If absolutely needed, ignore parts of it on MacOS.

Copy link
Member Author

Choose a reason for hiding this comment

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

OK in that case I am adding a warning for the future ourselves: aeb3e65

@barmac barmac merged commit 00da071 into main Feb 24, 2025
8 of 9 checks passed
@barmac barmac deleted the fix-broken-tests branch February 24, 2025 13:29
@bpmn-io-tasks bpmn-io-tasks bot removed the needs review Review pending label Feb 24, 2025
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