Skip to content

withKubectlLogs: actually follow the logs, and add timestamps - #132

Merged
thomasjm merged 1 commit into
masterfrom
fix-kubectl-logs-follow
Aug 29, 2026
Merged

thomasjm merged 1 commit into
masterfrom
fix-kubectl-logs-follow

Conversation

@thomasjm

Copy link
Copy Markdown
Collaborator

withKubectlLogs built its argument list as ["logs", target, "--namespace", ns, "--kubeconfig", path] — with no --follow. So kubectl dumped 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_*.log ended 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 the interruptWhenDone parameter 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.

@thomasjm
thomasjm merged commit f18e3d0 into master Aug 29, 2026
7 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant