Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from Jan 31, 2019

Conversation

Projects
None yet
6 participants
@achow101
Copy link
Member

commented Jan 31, 2019

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.

@Sjors

This comment has been minimized.

Copy link
Member

commented Jan 31, 2019

tACK 2c847e8, Travis permitting

@laanwj

This comment has been minimized.

Copy link
Member

commented Jan 31, 2019

Nice ! Thank you for doing this.

utACK 2c847e8

@Sjors

This comment has been minimized.

Copy link
Member

commented Jan 31, 2019

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

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

@MarcoFalke

This comment has been minimized.

Copy link
Member

commented Jan 31, 2019

@Sjors I am pretty sure this is an intermittent problem specific to macos and unrelated to any pull request.

@achow101 achow101 force-pushed the achow101:fix-tests-cli-args branch from 2c847e8 to 2e02341 Jan 31, 2019

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.
@achow101

This comment has been minimized.

Copy link
Member Author

commented Jan 31, 2019

@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.

@Sjors

This comment has been minimized.

Copy link
Member

commented Jan 31, 2019

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.

@jnewbery

This comment has been minimized.

Copy link
Member

commented Jan 31, 2019

utACK 2e02341

@MarcoFalke MarcoFalke merged commit 2e02341 into bitcoin:master Jan 31, 2019

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

MarcoFalke added a commit that referenced this pull request Jan 31, 2019

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

2e02341 tests: unify RPC argument to cli argument conversion and handle dicts and lists (Andrew Chow)

Pull request description:

  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.

Tree-SHA512: 472bef3cd78410a8552fd342b1852bcd7c57721cfa9176b26bacda6b0791cc0b3758561a529c4117a7428242f98bb7d5482b2a2dcd06bea0ef2b15ae26183405
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.