Page MenuHomePhabricator

tests: Mark functional tests not supporting bitcoin-cli (--usecli) as such
ClosedPublic

Authored by PiRK on Nov 7 2020, 16:03.

Details

Summary

The option --usecli was added to test_framework in PR11970. Running the test with this parameter will cause all RPCs to be sent through bitcoin-cli rather than directly over http. But the test were not all annotated accordingly. 74 tests were unnecessarily skipped.

Explicitely annotating the tests that do not support this option will allow to make this lack of support the exception, and identify these tests clearly as needing to be fixed in the future.

This commit has currently no effect, as self.supports_cli is still considered False by default. This will be changed in the next commit.

In addition to the tests skipped in the Core PR, I also found the following tests to not support --usecli:

  • abc_wallet_standardness: TypeError: Object of type 'Decimal' is not JSON serializable (will be fixed when backporting PR17705)
  • abc-magnetic-anomaly-mining: idem
  • p2p_blocksonly: idem
  • rpc_whitelist: AttributeError: 'NoneType' object has no attribute 'rfind' (this test was added after PR17675 and should have been skipped in Core as well)
  • abc_p2p_fullblocktest: OSError: [Errno 7] Argument list too long: '.../bitcoin-abc/build/src/bitcoin-cli'
  • wallet_groups : idem

This is a backport of Core PR17675 [1/2]
https://github.com/bitcoin/bitcoin/pull/17675/commits/993e38a4e2fa66093314b988dfbe459f46aa5864

Test Plan

test/functional/test_runner.py --usecli

Event Timeline

PiRK requested review of this revision.Nov 7 2020, 16:03

skip one more test (
wallet_groups.py), which would fail in next commit

PiRK planned changes to this revision.Nov 7 2020, 16:26

See D8317. I need to do some extra work to find out why tests support --usecli for Core but not ABC

PiRK edited the summary of this revision. (Show Details)

add more tests to the list of tests not support --usecli. Revision has been updated with more details accordingly.

deadalnix requested changes to this revision.Nov 8 2020, 14:55
deadalnix added a subscriber: deadalnix.

What about test/functional/mempool_package_onemore.py ?

test/functional/p2p_blocksonly.py
18

This doesn't seems to be in the original PR.

This revision now requires changes to proceed.Nov 8 2020, 14:55
PiRK requested review of this revision.EditedNov 9 2020, 09:55

What about test/functional/mempool_package_onemore.py ?

This test was introduced in Core PR15681. The rationale for the change seems to be allowing Child-Pays for Parent for pre-signed transactions on the Lightning Network. I do not know if we will ever need this.

test/functional/p2p_blocksonly.py
18

This fails for us and not for Core because of out of sequence backporting. Specifically this change to test_node.py on line 436, when we start using arg_to_cli to convert decimal numbers into strings:
https://github.com/bitcoin/bitcoin/pull/15235/files#diff-7f22a082e3a80ca2f212e36193f87dd80237035afedb7f15b116ef7fa265f3eeL436

The error generated by this (TypeError: Object of type 'Decimal' is not JSON serializable) is fixed in D8320.

This revision is now accepted and ready to land.Nov 9 2020, 23:56