-
Notifications
You must be signed in to change notification settings - Fork 115
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
Support timeout override for deployments #414
Changes from 6 commits
bcef1a1
2e6ecd7
a790066
62c071c
1e17062
488b6ca
9410951
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -307,6 +307,22 @@ def test_deploy_timed_out_based_on_progress_deadline | |
end | ||
end | ||
|
||
def test_deploy_timed_out_based_on_timeout_override | ||
Timecop.freeze do | ||
template = build_deployment_template | ||
template["metadata"]["annotations"][KubernetesDeploy::KubernetesResource::TIMEOUT_OVERRIDE_ANNOTATION] = "10S" | ||
deploy = build_synced_deployment( | ||
template: template, | ||
replica_sets: [build_rs_template(status: { "replica" => 1 })] | ||
) | ||
refute deploy.deploy_timed_out?, "Deploy not started shouldn't have timed out" | ||
deploy.deploy_started_at = Time.now.utc - 3.minutes | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This doesn't necessarily show that the annotation took precedence over the default and the progress deadline. IMO we should add an expired progress condition, an assertion as to what the default is, and an assertion on each edge of the time that the annotation specifies to prove it is the one causing the timeout. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've added assertions on each edge and changed |
||
|
||
assert_equal(KubernetesDeploy::KubernetesResource::STANDARD_TIMEOUT_MESSAGE + "\nLatest ReplicaSet: web-1", | ||
deploy.timeout_message.strip) | ||
end | ||
end | ||
|
||
def test_deploy_timed_out_based_on_progress_deadline_ignores_statuses_for_older_generations | ||
Timecop.freeze do | ||
deployment_status = { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this patch? Doesn't this change mean the pod could actually come up successfully?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't believe so, since
- ls
will always fail and the container will remain unready. Is there another way to ensure a timeout that I should be using?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I misread this as being an array of commands one of which is
ls
. The bad-probe template uses["test", "0", "-eq", "1"]
but it doesn't really matter.