Page MenuHomePhabricator

Fix ZMQ test occasional hang and modernize it
ClosedPublic

Authored by freetrader on Aug 31 2017, 12:52.

Details

Summary

This test hung regularly on Ubuntu 14.04, and has in particular been causing our recent Travis runs to error out due to timeouts.

This patch corrects the non-terminations of the test through the ZMQ context destruction fix added in John Newbery's Core commit 7c51e9f0dc67.

It also adapts some sections to the more recent Core version of the test, including running only 2 nodes (speeds up the test) and specifying a ZMQ socket receive timeout option.

It is the destruction of the ZMQ context that fixes the intermittent hanging problem. When the ZMQ context lingers, sys.exit(0) may not terminate the zmq_test.py program, which then causes the test runner to wait forever, which times out Travis.

Test Plan
../qa/pull-tester/rpc-tests.py zmq_test

Run it through Travis.

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Herald added 1 blocking reviewer(s): Restricted Project. · View Herald TranscriptAug 31 2017, 12:52

Looks good to me. I'll approve as me, and give deadalnix a chance to reply/critique python usage (I am a python nub).

If nothing happens in a few hours I'll approve as Bitcoin ABC as I see this as a fairly high priority fix. This fixes the hang 100% on my testing with my build setup.

Good work man! You rock!

qa/rpc-tests/zmq_test.py
102 ↗(On Diff #1288)

likestamp

This revision is now accepted and ready to land.Aug 31 2017, 15:28
This revision was automatically updated to reflect the committed changes.