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

rpctest: prevent process leak due to panics. #752

Merged
merged 2 commits into from
Jul 20, 2017

Conversation

davecgh
Copy link
Member

@davecgh davecgh commented Jul 20, 2017

Upstream commit bfe2ba4.


This adds a defer statement at the top of TestRpcServer which will attempt a recover which tears down all active harnesses in the event that one of the tests causes a panic in the main goroutine.

Before this commit, if a buggy test caused a panic while all integration tests were being executed, then any active harnesses would fail to be properly torn down. This would cause the running btcd processes to be leaked, possibly interfering with future test runs until the process was manually killed. This commit fixes such behavior.

In order to aide in debugging, when a test panics, the test number is printed out along with a full stack-trace from the start of the test to the panic point.

This commit adds a `defer` statement at the top of  `TestRpcServer`
which will attempt a `recover` which tears down all active harnesses in
the event that one of the tests causes a panic in the main goroutine.

Before this commit, if a buggy test caused a panic while all integration
tests were being executed, then any active harnesses would fail to be
properly torn down. This would cause the running btcd processes to be
leaked, possibly interfering with future test runs until the process was
manually killed. This commit fixes such behavior.

In order to aide in debugging, when a test panics, the test number is
printed out along with a full stack-trace from the start of the test to
the panic point.
Copy link
Member

@dajohi dajohi left a comment

Choose a reason for hiding this comment

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

OK

@davecgh davecgh merged commit 765e04c into decred:master Jul 20, 2017
@davecgh davecgh deleted the merge_rpc_test_recover branch July 20, 2017 14:39
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.

4 participants