HomePhabricator

fix multiprocessing part of interface_rpc test on MacOS

Description

fix multiprocessing part of interface_rpc test on MacOS

Summary:
For some reason, starting processes with spawn causes the following error:

Traceback (most recent call last):
  File "/home/pierre/dev/bitcoin-abc/test/functional/test_framework/test_framework.py", line 136, in main
    self.run_test()
  File "/home/pierre/dev/bitcoin-abc/test/functional/interface_rpc.py", line 124, in run_test
    self.test_work_queue_exceeded()
  File "/home/pierre/dev/bitcoin-abc/test/functional/interface_rpc.py", line 107, in test_work_queue_exceeded
    p.start()
  File "/usr/lib/python3.10/multiprocessing/process.py", line 121, in start
    self._popen = self._Popen(self)
  File "/usr/lib/python3.10/multiprocessing/context.py", line 224, in _Popen
    return _default_context.get_context().Process._Popen(process_obj)
  File "/usr/lib/python3.10/multiprocessing/context.py", line 288, in _Popen
    return Popen(process_obj)
  File "/usr/lib/python3.10/multiprocessing/popen_spawn_posix.py", line 32, in __init__
    super().__init__(process_obj)
  File "/usr/lib/python3.10/multiprocessing/popen_fork.py", line 19, in __init__
    self._launch(process_obj)
  File "/usr/lib/python3.10/multiprocessing/popen_spawn_posix.py", line 47, in _launch
    reduction.dump(process_obj, fp)
  File "/usr/lib/python3.10/multiprocessing/reduction.py", line 60, in dump
    ForkingPickler(file, protocol).dump(obj)
  File "/home/pierre/dev/bitcoin-abc/test/functional/test_framework/test_node.py", line 865, in __call__
    return self.cli.send_cli(self.command, *args, **kwargs)
  File "/home/pierre/dev/bitcoin-abc/test/functional/test_framework/test_node.py", line 938, in send_cli
    raise JSONRPCException(dict(code=int(code), message=message))
test_framework.authproxy.JSONRPCException: Method not found (-32601)

Spawn is the default on Mac OS, so we need to explicitely set it to "fork"

Test Plan: run functional tests on MacOS and linux

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

Differential Revision: https://reviews.bitcoinabc.org/D13218

Details

Provenance
PiRKAuthored on Mar 1 2023, 20:15
PiRKPushed on Mar 2 2023, 12:06
Reviewer
Restricted Project
Differential Revision
D13218: fix multiprocessing part of interface_rpc test on MacOS
Parents
rABCcb2bcb8b6c26: Improve the performance of removeForBlock
Branches
Unknown
Tags
Unknown