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 some spurious process manager test failures #2452

Conversation

winksaville
Copy link
Contributor

This provides a fix for #2297. I was able to replicate two spurious
failures. The first was KillError thrown by _kill_child, I've changed
the code so KillError is not thrown as there is really no reasonable
recovery that can be performed.

The second spurious error I saw was in _close where @waitpid would
return an error because the _child_pid was -1. This occurs in
packages/process/_test.pony::TestFileExecCapabilityIsRequired and
::_TestNonExecutablePathResultsInExecveError which are designed to fail
and _child_pid is always -1. This causes a failure to be always be
sent asynchronously and sometimes is actually gets reported.
failure is reported

This provides a fix for ponylang#2297. I was able to replicate two spurious
failures. The first was KillError thrown by _kill_child, I've changed
the code so KillError is not thrown as there is really no reasonable
recovery that can be performed.

The second spurious error I saw was in _close where @waitpid would
return an error because the _child_pid was -1. This occurs in
packages/process/_test.pony::TestFileExecCapabilityIsRequired and
::_TestNonExecutablePathResultsInExecveError which are designed to fail
and _child_pid is always -1. This causes a failure to be always be
sent asynchronously and sometimes is actually gets reported.
failure is reported
@@ -459,12 +477,22 @@ actor ProcessMonitor
_expect = _notifier.expect(this, qty)
_read_buf_size()

fun _kill_child() ? =>
fun _kill_child() =>
"""
Terminate the child process.
Copy link
Contributor

@mfelsche mfelsche Dec 27, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would love to know that this method uses SIGTERM first and, if this fails, SIGKILL from the docstring.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@SeanTAllen SeanTAllen added the changelog - fixed Automatically add "Fixed" CHANGELOG entry on merge label Jan 3, 2018
@SeanTAllen SeanTAllen merged commit 0040c2a into ponylang:master Jan 3, 2018
ponylang-main added a commit that referenced this pull request Jan 3, 2018
@winksaville winksaville deleted the Fix-some-spurious-process-manager-test-failures branch January 18, 2018 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog - fixed Automatically add "Fixed" CHANGELOG entry on merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants