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

Properly kill background testrpc instance #445

Merged
merged 1 commit into from
Sep 18, 2017

Conversation

frangio
Copy link
Contributor

@frangio frangio commented Sep 14, 2017

Fixes #431.

@cgewecke
Copy link
Contributor

@frangio Out of curiosity - could you describe what the bug was here?

@frangio
Copy link
Contributor Author

frangio commented Sep 14, 2017

@cgewecke Definitely!

The original script ran testrpc in the background, basically doing testrpc & and immediately afterwards saving the PID by testrpc_pid=$! to be able to kill it afterwards.

I merged testing and coverage scripts in #369, by defining a bash function called testrpc which would run the original or the instrumented instance depending on an environment variable. So now it was this function which was being run in the background by doing testrpc &. Running a function in the background is accomplished by running a new bash process in the background. Because of this our testrpc_pid variable then had the pid of the bash process. We were killing the bash process and not its testrpc child, leaving it orphaned.

I fixed it by moving around the &, so as to not run the function in the background and correctly get testrpc_pid.

@cgewecke
Copy link
Contributor

Ah! Awesome, thanks @frangio.

@frangio frangio merged commit f60c5ad into OpenZeppelin:master Sep 18, 2017
@frangio frangio deleted the fix-leftover-testrpc branch September 18, 2017 18:54
ProphetDaniel pushed a commit to classicdelta/Smart-Contracts that referenced this pull request Mar 9, 2018
Properly kill background testrpc instance
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.

2 participants