dogecoin/test/functional/test_framework
Wladimir J. van der Laan 4644b13b44
Merge #19632: test: Catch decimal.InvalidOperation from TestNodeCLI#send_cli
82fc4017b7 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 82fc4017b7

Tree-SHA512: 8c102b8bf831b05c5ca4b2e1feb5574dcbaed8cab0b2f22b013c5dfcb81788a38839a163dd1e2c6470ccbe5874214663b84485f45467738fd850ca38d539ae25
2020-08-05 16:27:54 +02:00
..
__init__.py
address.py Revert "[TESTS] Move base58 to own module to break circular dependency" 2020-06-10 11:54:25 -04:00
authproxy.py test: retry when write to a socket fails on macOS 2020-06-25 17:26:20 +07:00
blocktools.py [test] CScriptNum Decode Check as Unit Tests 2020-06-03 07:18:01 -07:00
coverage.py Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
descriptors.py Output a descriptor in createmultisig and addmultisigaddress 2020-01-30 23:55:36 -05:00
key.py [tests] move generate_wif_key to wallet_util.py 2020-06-10 12:10:02 -04:00
messages.py test: Update test framework p2p protocol version to 70016 2020-07-19 02:10:42 -04:00
mininode.py Merge #19489: test: Fail wait_until early if connection is lost 2020-08-04 11:21:13 +02:00
netutil.py scripted-diff: Update copyright in ./test 2019-03-02 10:58:35 -05:00
script.py Merge #19082: test: Moved the CScriptNum asserts into the unit test in script.py 2020-06-04 17:28:55 +02:00
script_util.py test: Remove unused, undocumented and misleading CScript.__add__ 2020-04-22 09:00:56 -04:00
segwit_addr.py Use BIP173 addresses in segwit.py test 2017-09-28 17:29:01 -07:00
siphash.py Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
socks5.py scripted-diff: Update copyright in ./test 2019-03-02 10:58:35 -05:00
test_framework.py test: fix intermittent p2p_ibd_txrelay race, add test_framework.py#wait_until 2020-07-19 13:37:54 +02:00
test_node.py test: Catch decimal.InvalidOperation from TestNodeCLI#send_cli 2020-07-30 18:45:53 -07:00
test_shell.py TestShell: Return self from setup() 2019-11-05 12:55:52 +01:00
util.py Merge #19208: test: move sync_blocks and sync_mempool functions to test_framework.py 2020-06-21 09:17:39 -04:00
wallet_util.py [tests] move generate_wif_key to wallet_util.py 2020-06-10 12:10:02 -04:00