-
Notifications
You must be signed in to change notification settings - Fork 27
Preserve subprocess output on timeout #122
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
Conversation
Use TimeoutExpired.stdout to capture partial output before timeout. Generate fallback XML if no output captured (hung containers). Prevents empty output for timed-out tests.
jzhou77
left a comment
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.
LGTM. Only a nit on formatting
k8s/agent-scaler/agent-scaler.yaml
Outdated
| spec: | ||
| containers: | ||
| - env: | ||
| - env: |
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.
revert this line
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.
Good catch. Done. Good thing I didn't restart the agent-scalers after deploy.
johscheuer
left a comment
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.
Changes LGTM, only one comment (nothing blocking).
| break | ||
| if timeout_time and time.time() > timeout_time: | ||
| log("<timed out>") | ||
| process.kill() |
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 have a strong opinion here, but should we first try to terminate() the process (sends SIGTERM) and then send the kill() (sends SIGKILL) if it doesn't terminate after a fixed amount of time? That should give the process some additional time to write the logs before shutting down.
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.
Sorry. Missed this @johscheuer . Making a new PR to implement.
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.
Use TimeoutExpired.stdout to capture partial output before timeout. Generate fallback XML if no output captured (hung containers). Prevents empty output for timed-out tests.
Already deployed and doesn't seem to break anything.