dash/test/functional/test_framework
Wladimir J. van der Laan 72f2882efe
Merge #19632: test: Catch decimal.InvalidOperation from TestNodeCLI#send_cli
82fc4017b774aaff8799c2b6e8ba5370d94dbf4d test: Catch decimal.InvalidOperation from TestNodeCLI#send_cli (Ben Woosley)

Pull request description:

  `decimal.InvalidOperation` is a special case of a float parsing error, which
  presumably should be handled in the same way as a general parsing error,
  rather than blow up.

  Alternatives include: logging the error, or re-raising with more information.

  Example log output:
  ```
      File "/home/travis/build/bitcoin/bitcoin/ci/scratch/build/bitcoin-i686-pc-linux-gnu/test/functional/test_framework/test_framework.py", line 603, in sync_all
        self.sync_blocks(nodes)
      File "/home/travis/build/bitcoin/bitcoin/ci/scratch/build/bitcoin-i686-pc-linux-gnu/test/functional/test_framework/test_framework.py", line 568, in sync_blocks
        best_hash = [x.getbestblockhash() for x in rpc_connections]
      File "/home/travis/build/bitcoin/bitcoin/ci/scratch/build/bitcoin-i686-pc-linux-gnu/test/functional/test_framework/test_framework.py", line 568, in <listcomp>
        best_hash = [x.getbestblockhash() for x in rpc_connections]
      File "/home/travis/build/bitcoin/bitcoin/ci/scratch/build/bitcoin-i686-pc-linux-gnu/test/functional/test_framework/test_node.py", line 571, in __call__
        return self.cli.send_cli(self.command, *args, **kwargs)
      File "/home/travis/build/bitcoin/bitcoin/ci/scratch/build/bitcoin-i686-pc-linux-gnu/test/functional/test_framework/test_node.py", line 639, in send_cli
        return json.loads(cli_stdout, parse_float=decimal.Decimal)
      File "/usr/lib64/python3.6/json/__init__.py", line 367, in loads
        return cls(**kw).decode(s)
      File "/usr/lib64/python3.6/json/decoder.py", line 339, in decode
        obj, end = self.raw_decode(s, idx=_w(s, 0).end())
      File "/usr/lib64/python3.6/json/decoder.py", line 355, in raw_decode
        obj, end = self.scan_once(s, idx)
    decimal.InvalidOperation: [<class 'decimal.InvalidOperation'>]
  ```
  See: https://travis-ci.org/github/bitcoin/bitcoin/jobs/713502326

ACKs for top commit:
  laanwj:
    ACK 82fc4017b774aaff8799c2b6e8ba5370d94dbf4d

Tree-SHA512: 8c102b8bf831b05c5ca4b2e1feb5574dcbaed8cab0b2f22b013c5dfcb81788a38839a163dd1e2c6470ccbe5874214663b84485f45467738fd850ca38d539ae25
2021-09-18 21:46:27 -04:00
..
__init__.py
address.py merge #14954: Require python 3.5 2021-08-31 11:16:12 +05:30
authproxy.py Merge #15495: Add regtests for HTTP status codes 2021-09-10 20:56:00 -04:00
bignum.py
blocktools.py merge #14954: Require python 3.5 2021-08-31 11:16:12 +05:30
coverage.py Some Dashification (#3513) 2020-06-11 11:39:04 +03:00
key.py Merge #14365: tests: Add Python dead code linter (vulture) to Travis 2021-08-12 14:42:32 -03:00
messages.py merge #14954: Require python 3.5 2021-08-31 11:16:12 +05:30
mininode.py Merge #19599: test: clean message_count and last_message 2021-09-18 21:46:26 -04:00
netutil.py merge #14954: Require python 3.5 2021-08-31 11:16:12 +05:30
script.py merge #14954: Require python 3.5 2021-08-31 11:16:12 +05:30
siphash.py
socks5.py merge #14954: Require python 3.5 2021-08-31 11:16:12 +05:30
test_framework.py Merge #15963: [tests] Make random seed logged and settable 2021-09-12 14:15:10 -04:00
test_node.py Merge #19632: test: Catch decimal.InvalidOperation from TestNodeCLI#send_cli 2021-09-18 21:46:27 -04:00
util.py Merge #17330: test: Add shrinkdebugfile=0 to regtest bitcoin.conf 2021-09-15 13:54:39 -04:00