Skip to content
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

Fix syntax error in dogwrap timeout handler and always collect output #538

Merged
merged 2 commits into from
Feb 26, 2020

Conversation

Matt343
Copy link
Contributor

@Matt343 Matt343 commented Feb 20, 2020

What does this PR do?

This PR addresses a bug in the timeout handling code in the dogwrap script (#537). If the --timeout argument is used and the child process does not exit before the timeout expires, a syntax error was thrown and no event was sent to the Datadog API.

Description of the Change

I fixed the print syntax within the timeout handling, and also ensured that the stdout and stderr of the child process are still collected if the process times out (this was skipped previously).

Alternate Designs

Possible Drawbacks

Verification Process

I added tests for this behavior, using mocks to simulate different subprocess behavior. (I originally tried to actually run a child process in the tests, but the behavior for signal handling in Azure devops seemed different from local. Someone with more experience in this CI environment could probably add more comprehensive testing 😄)

I also ran the dogwrap script from the command line, with various timeout behaviors, to demonstrate that the error was resolved and the event contained the output from the child process.

Additional Notes

Release Notes

Review checklist (to be filled by reviewers)

  • Feature or bug fix MUST have appropriate tests (unit, integration, etc...)
  • PR title must be written as a CHANGELOG entry (see why)
  • Files changes must correspond to the primary purpose of the PR as described in the title (small unrelated changes should have their own PR)
  • PR must have one changelog/ label attached. If applicable it should have the backward-incompatible label attached.
  • PR should not have do-not-merge/ label attached.
  • If Applicable, issue must have kind/ and severity/ labels attached at least.

@Matt343 Matt343 requested a review from a team as a code owner February 20, 2020 23:28
@jirikuncar
Copy link
Contributor

/azp run DataDog.datadogpy.integration

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jirikuncar jirikuncar added changelog/Fixed Fixed features results into a bug fix version bump resource/dogshell labels Feb 21, 2020
@zippolyte zippolyte merged commit 3027b12 into DataDog:master Feb 26, 2020
@zippolyte zippolyte mentioned this pull request Feb 26, 2020
6 tasks
@zippolyte zippolyte changed the title Fix syntax error in dogwrap timeout handler and always collect output (#537) Fix syntax error in dogwrap timeout handler and always collect output Mar 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog/Fixed Fixed features results into a bug fix version bump resource/dogshell
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants