Skip to content

Commit

Permalink
Auto merge of #2760 - bitcartel:fix_wallet_test_pipe_error, r=str4d
Browse files Browse the repository at this point in the history
Fix broken pipe error on some platforms when running QA test wallet.py.

Closes #2759.
  • Loading branch information
zkbot committed Nov 28, 2017
2 parents 9ce4859 + 159aa37 commit ce72b49
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions qa/rpc-tests/wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,16 @@ def run_test (self):
for i in xrange(0,num_t_recipients):
newtaddr = self.nodes[2].getnewaddress()
recipients.append({"address":newtaddr, "amount":amount_per_recipient})

# Issue #2759 Workaround START
# HTTP connection to node 0 may fall into a state, during the few minutes it takes to process
# loop above to create new addresses, that when z_sendmany is called with a large amount of
# rpc data in recipients, the connection fails with a 'broken pipe' error. Making a RPC call
# to node 0 before calling z_sendmany appears to fix this issue, perhaps putting the HTTP
# connection into a good state to handle a large amount of data in recipients.
self.nodes[0].getinfo()
# Issue #2759 Workaround END

try:
self.nodes[0].z_sendmany(myzaddr, recipients)
except JSONRPCException,e:
Expand All @@ -288,6 +298,11 @@ def run_test (self):
for i in xrange(0,num_z_recipients):
newzaddr = self.nodes[2].z_getnewaddress()
recipients.append({"address":newzaddr, "amount":amount_per_recipient})

# Issue #2759 Workaround START
self.nodes[0].getinfo()
# Issue #2759 Workaround END

try:
self.nodes[0].z_sendmany(myzaddr, recipients)
except JSONRPCException,e:
Expand Down

0 comments on commit ce72b49

Please sign in to comment.