tests: When testing with –usecli, unify RPC arg to cli arg conversion and handle dicts and lists #15301

pull achow101 wants to merge 1 commits into bitcoin:master from achow101:fix-tests-cli-args changing 1 files +10 −2
  1. achow101 commented at 3:38 pm on January 31, 2019: member

    When running tests with –usecli, unify the conversion from argument objects to strings using a new function arg_to_cli(). This fixes boolean arguments when using named arguments.

    Also use json.dumps() to get the string values for arguments that are dicts and lists so that bitcoind’s JSON parser does not become confused.

  2. fanquake added the label Tests on Jan 31, 2019
  3. Sjors commented at 4:16 pm on January 31, 2019: member
    tACK 2c847e8, Travis permitting
  4. laanwj commented at 4:20 pm on January 31, 2019: member

    Nice ! Thank you for doing this.

    utACK 2c847e8c10ccf06d6deb8650ee2f31204599fc0e

  5. Sjors commented at 4:38 pm on January 31, 2019: member

    p2p_invalid_messages.py failed on Travis and also on my machine with macOS 10.14.3:

    02019-01-31T16:36:14.813000Z TestFramework (INFO): Sending a bunch of large, junk messages to test memory exhaustion. May take a bit...
    12019-01-31T16:36:18.519000Z TestFramework (INFO): Waiting for node to drop junk messages.
    2Fatal write error on socket transport
    3protocol: <test_framework.mininode.P2PDataStore object at 0x10ebcb8d0>
    4transport: <_SelectorSocketTransport fd=11 read=polling write=<idle, bufsize=0>>
    5Traceback (most recent call last):
    6  File "/Users/bitcoin/.pyenv/versions/3.4.9/lib/python3.4/asyncio/selector_events.py", line 701, in write
    7    n = self._sock.send(data)
    8OSError: [Errno 41] Protocol wrong type for socket
    

    The problem goes away when I rebase on master, which includes #15246. I assume merging will have the same effect.

  6. MarcoFalke commented at 4:58 pm on January 31, 2019: member
    @Sjors I am pretty sure this is an intermittent problem specific to macos and unrelated to any pull request.
  7. achow101 force-pushed on Jan 31, 2019
  8. tests: unify RPC argument to cli argument conversion and handle dicts and lists
    When running tests with --usecli, unify the conversion from argument objects to
    strings using a new function arg_to_cli(). This fixes boolean arguments when
    using named arguments.
    
    Also use json.dumps() to get the string values for arguments that are dicts and
    lists so that bitcoind's JSON parser does not become confused.
    2e023419c5
  9. achow101 commented at 5:38 pm on January 31, 2019: member
    @sjors I’ve rebased it but I’m not sure that will matter. This was built on top of the latest master from a couple of hours ago.
  10. Sjors commented at 6:05 pm on January 31, 2019: member

    tACK 2e02341

    Weirdly enough it’s spitting out that fatal write error on socket transport even when the test passes, so yeah, let’s ignore that here.

  11. jnewbery commented at 10:24 pm on January 31, 2019: member
    utACK 2e023419c5e77ba66fe1182cbc2bcabce59ea795
  12. MarcoFalke merged this on Jan 31, 2019
  13. MarcoFalke closed this on Jan 31, 2019

  14. MarcoFalke referenced this in commit cb35f1d305 on Jan 31, 2019
  15. DrahtBot locked this on Dec 16, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-17 09:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me