[manager/orchestrator/task_reaper] Fix task reaper test to also set the desired state on tasks to prevent reconciliation races#2526
Merged
Conversation
…he desired state on tasks to revent reconciliation races. Signed-off-by: Anshul Pundir <anshul.pundir@docker.com>
Contributor
Author
|
#2510 addresses this, but that might not go in for a while. |
Codecov Report
@@ Coverage Diff @@
## master #2526 +/- ##
==========================================
+ Coverage 61.35% 61.36% +<.01%
==========================================
Files 133 133
Lines 21726 21726
==========================================
+ Hits 13330 13332 +2
- Misses 6952 6962 +10
+ Partials 1444 1432 -12 |
Collaborator
|
LGTM |
dperny
approved these changes
Feb 26, 2018
|
|
||
| // Set both tasks to COMPLETED. | ||
| updatedTask3 := observedTask1.Copy() | ||
| updatedTask3.DesiredState = api.TaskStateCompleted |
Contributor
There was a problem hiding this comment.
I'm in favor of setting this to api.TaskStateShutdown because this is what happens in actual behavior (even though the test would work fine with this).
nishanttotla
approved these changes
Feb 26, 2018
Contributor
nishanttotla
left a comment
There was a problem hiding this comment.
LGTM (since my comment doesn't really affect this test as such)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We force set the task state in the unit-tests to verify task reaper behavior, but don't set the desired state, which triggers reconciliation which can race with further task related changes triggered from the unit-test.
Signed-off-by: Anshul Pundir anshul.pundir@docker.com