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

Check task is correctly added on parallel TaskService#addTask calls #547

Merged
merged 4 commits into from
Feb 15, 2023

Conversation

mcornaton
Copy link
Contributor

No description provided.

Copy link
Contributor

@jbern0rd jbern0rd left a comment

Choose a reason for hiding this comment

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

Thanks

// while the other one has failed.
final Optional<Task> task1 = results.get(0);
final Optional<Task> task2 = results.get(1);
assertThat(task1.isEmpty() || task2.isEmpty()).isTrue();
Copy link
Member

Choose a reason for hiding this comment

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

Aren't you looking for a XOR ^ instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right! I have looked for assertThatExactlyOneIsTrue or some similar method, but couldn't get any result. Thanks for the XOR idea, it's a good amelioration.
Please see 467da7d.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Based on a suggestion from @jbern0rd, I've refactored this part. We can now add more than 2 tasks at the same time. This helps to prove the robustness of our code. Please see 929b3fc.

Copy link
Member

@jeremyjams jeremyjams left a comment

Choose a reason for hiding this comment

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

Thanks 👍

@mcornaton mcornaton force-pushed the bugfix/task-added-twice branch from 929b3fc to d7f7563 Compare February 14, 2023 15:09
@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
0.0% 0.0% Duplication

@mcornaton mcornaton merged commit a3d8679 into develop Feb 15, 2023
@mcornaton mcornaton deleted the bugfix/task-added-twice branch February 15, 2023 07:46
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.

3 participants