Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid race condition in LocalBitcoinNodeTests
Previously, Travis CI was failing non-deterministically due to a race condition in which a thread was started in order to call the blocking ServerSocket.accept() method, and sometimes the subsequent attempt by LocalBitcoinNode.detectAndRun() to connect to that socket's port would occur before the thread had actually called the accept() method. This commit simplifies the approach by removing the thread entirely. As it turns out, calling accept() is not necessary; simply constructing a new ServerSocket() binds to and listens on the given port, such that a subsequent attempt to connect() will succeed.
- Loading branch information