This repository has been archived by the owner on Aug 7, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rpctest: prevent leaking processes in tests due to panics
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.
- Loading branch information