withKubectlLogs: actually follow the logs, and add timestamps - #132
Merged
Merged
Conversation
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.
withKubectlLogsbuilt its argument list as["logs", target, "--namespace", ns, "--kubeconfig", path]— with no--follow. Sokubectldumped whatever was buffered at the moment it started and exited immediately, leaving a one-shot snapshot of the pod's startup rather than a log of the test run.This was masking a flaky Kubernetes test elsewhere: every captured
pod_*.logended right where the pods went Ready, so there was no way to see what a replica was doing when a test failed. The giveaway was a pod that logs a line every 5 seconds for as long as it lives producing exactly 8 of them over a 13-minute run.Adds
--follow, so the process runs for the lifetime of the bracket — which is what the surrounding code already assumes, given theinterruptWhenDoneparameter and the doc comment's note about needing a rerun if the pod goes away.Also adds
--timestamps, so pod output can be lined up against the test timeline. This changes the log file format.Verified against a minikube suite (81 tests, 9 pods): logs previously stopped at pod startup and now span the whole test window.