HomePhabricator

Fix rpc_bind flakiness

Description

Fix rpc_bind flakiness

Summary:
Attempt to fix the rpc_bind.py flakiness:

Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line
120, in main
    self.run_test()
  File "/work/test/functional/rpc_bind.py", line 136, in run_test
    self._run_nonloopback_tests()
  File "/work/test/functional/rpc_bind.py", line 171, in
_run_nonloopback_tests
    [(self.non_loopback_ip, self.defaultport)])
  File "/work/test/functional/rpc_bind.py", line 72, in run_bind_test
    assert_equal(set(get_bind_addrs(pid)), set(expected))
  File "/work/test/functional/test_framework/netutil.py", line 87, in
get_bind_addrs
    inodes = get_socket_inodes(pid)
  File "/work/test/functional/test_framework/netutil.py", line 37, in
get_socket_inodes
    target = os.readlink(os.path.join(base, item))
FileNotFoundError: [Errno 2] No such file or directory:
'/proc/7775/fd/26'

This diff catches the case where a file descriptor is removed between
the time the content directory is listed and the time each link is
parsed. This can happen under normal circumstances and should not
cause the tests to fail.

Test Plan:

./test/functional/test_runner.py rpc_bind

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

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

Details

Provenance
FabienAuthored on Feb 3 2021, 12:33
abc-botPushed on Feb 3 2021, 12:40
Reviewer
Restricted Project
Differential Revision
D8350: Fix rpc_bind flakiness
Parents
rABCba4e8e9d97a7: log: Remove "No rpcpassword set" from logs
Branches
Unknown
Tags
Unknown