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 flawed concurrency test (concurrent write on non-atomic int) #1835

Merged
merged 1 commit into from
Dec 21, 2023

Conversation

flomnes
Copy link
Member

@flomnes flomnes commented Dec 19, 2023

Multiple threads writing to a non-atomic object is UB. Use std::atomic to guarantee result and fix broken test.

D:/a/Antares_Simulator/Antares_Simulator/src/tests/src/libs/antares/concurrency/test_concurrency.cpp(86): error: in "test_future_set": check counter == 10 has failed

@flomnes flomnes added bug Something isn't working tests labels Dec 19, 2023

Watermelon AI Summary

AI Summary deactivated by flomnes

GitHub PRs

Antares_Simulator is an open repo and Watermelon will serve it for free.
🍉🫶
Have you starred Watermelon?

@flomnes flomnes mentioned this pull request Dec 19, 2023
Copy link
Contributor

@sylvlecl sylvlecl left a comment

Choose a reason for hiding this comment

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

Thanks!

Copy link

sonarcloud bot commented Dec 19, 2023

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@flomnes flomnes merged commit cd61c74 into develop Dec 21, 2023
6 checks passed
@flomnes flomnes deleted the fix/broken-concurrency-test branch December 21, 2023 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working size/XS tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants