test: verify upgrade drain honors grace period and aborts on failure - #3227
Merged
talos-bot merged 1 commit intoAug 10, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds an end-to-end integration suite that validates Omni-managed upgrade draining on Talos ≥ 1.13: eviction uses each pod’s terminationGracePeriodSeconds, drain failures surface (instead of being swallowed), and nodes do not reboot until workloads are fully gone. This complements the existing integration suite coverage by testing the full upgrade + drain timeline with real Kubernetes workload behavior.
Changes:
- Registers a new integration sub-suite
DrainTerminationGracePeriodin the mainTestIntegrationsuite list. - Introduces a new integration test (
internal/integration/drain_test.go) that deploys a slow-terminating workload with a PDB, runs an upgrade, samples cluster/Omni state, and asserts drain/grace-period/reboot ordering. - Adds a dedicated CI job + cron workflow for running this new slow e2e suite and wires it into Slack notifications via regenerated Kres outputs.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| internal/integration/integration_test.go | Adds the new DrainTerminationGracePeriod suite to TestIntegration. |
| internal/integration/drain_test.go | New integration test that deploys a slow termination workload and asserts drain honors grace period and blocks reboot until completion. |
| .kres.yaml | Adds a new Kres-defined e2e job configuration for the drain grace period suite. |
| .github/workflows/slack-notify.yaml | Regenerated to include the new cron workflow in notifications. |
| .github/workflows/slack-notify-ci-failure.yaml | Regenerated to include the new cron workflow in CI failure notifications. |
| .github/workflows/e2e-drain-grace-period-cron.yaml | New generated cron workflow to run the drain grace period suite on a schedule. |
| .github/workflows/ci.yaml | Adds a label-triggered CI job to run the drain grace period e2e suite. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+524
to
+527
| // The whole point of draining before rebooting: the machine only goes down once the pod is gone. | ||
| assert.True(t, node.rebootedAt.After(pod.goneAt), | ||
| "node %q rebooted at %s, before the pod finished terminating at %s", | ||
| pod.nodeName, node.rebootedAt, pod.goneAt) |
oguzkilcan
force-pushed
the
test/upgrade-drain-grace-period
branch
from
August 6, 2026 19:27
3c4f4c5 to
73b8b15
Compare
Slessi
approved these changes
Aug 7, 2026
oguzkilcan
force-pushed
the
test/upgrade-drain-grace-period
branch
from
August 7, 2026 09:26
73b8b15 to
fe47b91
Compare
oguzkilcan
force-pushed
the
test/upgrade-drain-grace-period
branch
from
August 7, 2026 09:57
fe47b91 to
2e26751
Compare
oguzkilcan
force-pushed
the
test/upgrade-drain-grace-period
branch
from
August 7, 2026 11:03
2e26751 to
b198e93
Compare
oguzkilcan
force-pushed
the
test/upgrade-drain-grace-period
branch
from
August 7, 2026 11:07
b198e93 to
8257cd4
Compare
oguzkilcan
force-pushed
the
test/upgrade-drain-grace-period
branch
from
August 7, 2026 14:32
8257cd4 to
3a53fa1
Compare
Before Talos 1.13 the drain happened inside machined as part of the upgrade sequence. It evicted every pod with a hardcoded 60 second grace period, and it logged eviction failures instead of returning them, so the node rebooted whether or not the workload had actually finished shutting down. Omni now runs the drain itself for cluster on 1.13 and up, passing each pod's own terminationGracePeriodSeconds through and refusing to reboot when the drain does not complete. Nothing covered that end to end. The new suite parks a two-replica workload behind a PodDisruptionBudget, has it ignore SIGTERM for six minutes, then upgrades the cluster and rebuilds the drain timeline by sampling pod, node and ClusterMachineConfigStatus state. It checks that the eviction carried the pod's full grace period rather than a fixed one, that the drain failure surfaced instead of being swallowed, and that the node's boot ID only changed once the pod was gone. Signed-off-by: Oguz Kilcan <oguz.kilcan@siderolabs.com>
oguzkilcan
force-pushed
the
test/upgrade-drain-grace-period
branch
from
August 10, 2026 10:56
3a53fa1 to
38299fa
Compare
Unix4ever
approved these changes
Aug 10, 2026
Member
Author
|
/m |
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.
Before Talos 1.13 the drain happened inside machined as part of the upgrade sequence. It evicted every pod with a hardcoded 60 second grace period, and it logged eviction failures instead of returning them, so the node rebooted whether or not the workload had actually finished shutting down.
Omni now runs the drain itself for cluster on 1.13 and up, passing each pod's own terminationGracePeriodSeconds through and refusing to reboot when the drain does not complete.
Nothing covered that end to end. The new suite parks a two-replica workload behind a PodDisruptionBudget, has it ignore SIGTERM for six minutes, then upgrades the cluster and rebuilds the drain timeline by sampling pod, node and ClusterMachineConfigStatus state. It checks that the eviction carried the pod's full grace period rather than a fixed one, that the drain failure surfaced instead of being swallowed, and that the node's boot ID only changed once the pod was gone.