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 expectations in lock manager test #9592

Merged
merged 3 commits into from
Apr 2, 2024

Conversation

hubertp
Copy link
Contributor

@hubertp hubertp commented Apr 2, 2024

Pull Request Description

The test optimistically assumed that threads will mostly execute in order, while ignoring all other possibilities.
Changes the order of the report so that we remove the potential non-determinism.

As discovered in https://github.com/enso-org/enso/actions/runs/8516468592/job/23325541262?pr=9584#step:8:1530

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • All code follows the
    Scala,
    Java,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • All code has been tested:
    • Unit tests have been written where possible.

The test optimistically assumed that threads will mostly
execute in order, while ignoring all other possibilities.
This change adds missing expectations.

As discovered in https://github.com/enso-org/enso/actions/runs/8516468592/job/23325541262?pr=9584#step:8:1530
@hubertp
Copy link
Contributor Author

hubertp commented Apr 2, 2024

Adding @radeusgd in /cc as you wrote the library/tests

@hubertp hubertp added the CI: No changelog needed Do not require a changelog entry for this PR. label Apr 2, 2024
@hubertp hubertp requested a review from radeusgd April 2, 2024 10:13
Copy link
Member

@radeusgd radeusgd left a comment

Choose a reason for hiding this comment

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

Thanks for fixing the test

@radeusgd
Copy link
Member

radeusgd commented Apr 2, 2024

The test optimistically assumed that threads will mostly execute in order, while ignoring all other possibilities.

I'd just like to correct that I was not 'optimistically' assuming the ordering - the whole purpose of TestSynchronizer was to ensure correct ordering of events. It was just an oversight that the order of report and signal was mixed up - I must have indeed wrongly assumed that these 2 operations will mostly execute atomically, but obviously they weren't, so report always must come before corresponding signal to avoid unexpected paths.

@hubertp hubertp added the CI: Ready to merge This PR is eligible for automatic merge label Apr 2, 2024
@mergify mergify bot merged commit ab5fe17 into develop Apr 2, 2024
40 of 42 checks passed
@mergify mergify bot deleted the wip/hubert/fix-expectations-lock-manager branch April 2, 2024 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: No changelog needed Do not require a changelog entry for this PR. CI: Ready to merge This PR is eligible for automatic merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants