Add lifecycle hooks test and verify probe coverage#15
Merged
Conversation
Co-authored-by: dciangot <4144326+dciangot@users.noreply.github.com>
Co-authored-by: dciangot <4144326+dciangot@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add test case to check preStop hook for a pod
Add lifecycle hooks test and verify probe coverage
Jan 28, 2026
There was a problem hiding this comment.
Pull request overview
Adds a new vk-test-set template intended to validate Kubernetes container lifecycle hooks (postStart/preStop) and documents that existing probe tests already cover startup/liveness/readiness probes.
Changes:
- Added a new
115-lifecycle-hooks.yamltemplate that uses apostStarthook to create a marker file and validates it from the main container. - Added log-based validations intended to confirm
preStophook execution order/messages. - Confirmed probe-type coverage is already handled by existing
090-probes.yaml(no changes made there).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
… exit Agent-Logs-Url: https://github.com/interlink-hq/vk-test-set/sessions/0b0f4e86-e402-4360-b091-c7eca0d40329 Co-authored-by: dciangot <4144326+dciangot@users.noreply.github.com>
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.
Adds test coverage for Kubernetes lifecycle hooks (postStart/preStop) and confirms all probe types are tested.
Changes
New test template:
115-lifecycle-hooks.yaml/tmp/poststart-marker, validated by main containerProbe coverage verification
090-probes.yamlcovers all three probe types: startup, liveness, readinessImplementation notes
The postStart hook uses
tee+ append to avoid race conditions:The container runs indefinitely (
while true; do sleep 30; done) so that preStop is triggered during pod deletion by cleanup, not by normal container exit. preStop hook execution is validated by ensuring the pod deletion completes without errors. Direct log validation of preStop output is not possible because cleanup occurs after validation completes in the test framework.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.