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

Update deployment health on failed allocations only if health is unset #5645

Merged
merged 3 commits into from
May 3, 2019

Conversation

preetapan
Copy link
Member

This fixes a confusing UX where a previously successful deployment's
healthy/unhealthy count would get updated if any allocations failed after
the deployment was already marked as successful.

This fixes a confusing UX where a previously successful deployment's
healthy/unhealthy count would get updated if any allocations failed after
the deployment was already marked as successful.
@@ -780,7 +780,7 @@ func TestAllocRunner_HandlesArtifactFailure(t *testing.T) {

// Test that alloc runner kills tasks in task group when another task fails
func TestAllocRunner_TaskFailed_KillTG(t *testing.T) {
alloc := mock.BatchAlloc()
alloc := mock.Alloc()
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 modified this existing test to change it to use a service job rather than batch so that it will get the DeploymentStatus field. Could use feedback on whether this is the best way to test this.

Copy link
Member

Choose a reason for hiding this comment

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

I think this is asserting reasonable things, but I think it would have passed before?

Restoring a Failed alloc with a Healthy DeploymentStatus and asserting ar.AllocState().DeploymentStatus.IsHealthy() would have failed before but worked now I think.

Copy link
Member Author

Choose a reason for hiding this comment

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

@schmichael is there an existing test you could point me to as an example? I am not able to get this test's DeploymentStatus to become healthy through the mock driver.

client/allocrunner/alloc_runner.go Outdated Show resolved Hide resolved
client/allocrunner/alloc_runner.go Outdated Show resolved Hide resolved
@@ -780,7 +780,7 @@ func TestAllocRunner_HandlesArtifactFailure(t *testing.T) {

// Test that alloc runner kills tasks in task group when another task fails
func TestAllocRunner_TaskFailed_KillTG(t *testing.T) {
alloc := mock.BatchAlloc()
alloc := mock.Alloc()
Copy link
Member

Choose a reason for hiding this comment

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

I think this is asserting reasonable things, but I think it would have passed before?

Restoring a Failed alloc with a Healthy DeploymentStatus and asserting ar.AllocState().DeploymentStatus.IsHealthy() would have failed before but worked now I think.

@preetapan preetapan requested a review from nickethier May 3, 2019 14:41
schmichael and others added 2 commits May 3, 2019 10:00
Co-Authored-By: preetapan <preetha@hashicorp.com>
Co-Authored-By: preetapan <preetha@hashicorp.com>
@preetapan preetapan merged commit e85d31e into master May 3, 2019
@preetapan preetapan deleted the b-deploy-health branch May 3, 2019 22:04
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants