Page MenuHomePhabricator

Merge #12843: [tests] Test starting bitcoind with -h and -version
ClosedPublic

Authored by nakihito on Jun 6 2019, 18:04.

Details

Summary

63048ec73d [tests] Test starting bitcoind with -h and -version (John Newbery)

Pull request description:

Test that starting bitcoind/bitcoin-qt with `-h` and `-version` works as expected.

Prompted by https://github.com/bitcoin/bitcoin/pull/10762#commitcomment-28345993, which is a nullpointer dereference triggered by starting bitcoin-qt with `-h`.

On master, this test passes when run over bitcoind, but fails when running over bitcoin-qt. I used xvfb as a virtual frame buffer to test:

```
BITCOIND=/home/ubuntu/bitcoin/src/qt/bitcoin-qt xvfb-run ./feature_help.py --nocleanup
2018-03-30T17:09:37.767000Z TestFramework (INFO): Initializing test directory /tmp/user/1000/testdi4dre13
2018-03-30T17:09:37.767000Z TestFramework (INFO): Start bitcoin with -h for help text
2018-03-30T17:09:37.841000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/home/ubuntu/bitcoin/test/functional/test_framework/test_framework.py", line 126, in main
    self.run_test()
  File "./feature_help.py", line 25, in run_test
    assert_equal(ret_code, 0)
  File "/home/ubuntu/bitcoin/test/functional/test_framework/util.py", line 39, in assert_equal
    raise AssertionError("not(%s)" % " == ".join(str(arg) for arg in (thing1, thing2) + args))
AssertionError: not(-11 == 0)
2018-03-30T17:09:37.842000Z TestFramework (INFO): Stopping nodes
Traceback (most recent call last):
  File "./feature_help.py", line 42, in <module>
    HelpTest().main()
  File "/home/ubuntu/bitcoin/test/functional/test_framework/test_framework.py", line 149, in main
    self.stop_nodes()
  File "/home/ubuntu/bitcoin/test/functional/test_framework/test_framework.py", line 273, in stop_nodes
    node.stop_node()
  File "/home/ubuntu/bitcoin/test/functional/test_framework/test_node.py", line 141, in stop_node
    self.stop()
  File "/home/ubuntu/bitcoin/test/functional/test_framework/test_node.py", line 87, in __getattr__
    assert self.rpc_connected and self.rpc is not None, "Error: no RPC connection"
AssertionError: Error: no RPC connection
```

Passes for bitcoind and bitcoin-qt when run on #12836.

Longer term, we should consider running functional tests over bitcoin-qt in one of the Travis jobs.

Tree-SHA512: 0c2f40f3d5f0e78c3a1b07dbee8fd383eebab27ed0bf2a98a5b9cc66613dbd7b70e363c56163a37e02f68ae7ff7b3ae1769705d0e110ca68a00f8693315730a4

Backport of Core PR12843
https://github.com/bitcoin/bitcoin/pull/12843/

Completes T569

Test Plan
test_runner.py should also run the feature_help.py test and pass
test_runner.py feature_help should run and pass

Diff Detail

Repository
rABC Bitcoin ABC
Branch
PR12843
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 6188
Build 10423: Bitcoin ABC Buildbot (legacy)
Build 10422: arc lint + arc unit

Event Timeline

Owners added a reviewer: Restricted Owners Package.Jun 6 2019, 18:04
This revision is now accepted and ready to land.Jun 6 2019, 18:11
Fabien requested changes to this revision.Jun 6 2019, 18:22

I thought that T540 was a dependency for this one, I might be mistaken.

It's missing the timings.json update.

This revision now requires changes to proceed.Jun 6 2019, 18:22

Added feature_help.py to timing.json.

In D3234#76410, @Fabien wrote:

I thought that T540 was a dependency for this one, I might be mistaken.

I didn't have any trouble running the test or backport the change without T540. I was going to work on that next if it really is deemed necessary.

Fabien added inline comments.
test/functional/timing.json
414 ↗(On Diff #9196)

Don't add a newline, this is a generated file

This revision is now accepted and ready to land.Jun 6 2019, 19:55

Removed newline at end of timing.json.