[tests] fix disconnect_ban intermittency #10376

pull jnewbery wants to merge 1 commits into bitcoin:master from jnewbery:disconnect_ban_flakiness changing 1 files +7 −1
  1. jnewbery commented at 9:26 PM on May 9, 2017: member

    Fixes another functional test race. disconnect_ban.py bans a subnet with a one second expiry and then immediately tests that the subnet is banned. Due to the #10234, calls to listbanned() now result in a disk flush, which can block on busy systems (for example when running multiple functional tests in parallel).

    Fix is to use mocktime to control when the ban expires.

  2. [tests] fix disconnect_ban intermittency 3ba2c08980
  3. paveljanik commented at 9:13 AM on May 10, 2017: contributor

    Sorry, but I was not able to reproduce the failure on my systems, so I can't provide tested ACK.

    Out of 1000 runs, I have got 8 of this only:

    2017-05-10 08:58:54.014000 TestFramework (ERROR): Assertion failed
    Traceback (most recent call last):
      File "/private/tmp/bitcoin-master/test/functional/test_framework/util.py", line 281, in start_nodes
        rpcs.append(start_node(i, dirname, extra_args[i], rpchost, timewait=timewait, binary=binary[i]))
      File "/private/tmp/bitcoin-master/test/functional/test_framework/util.py", line 242, in start_node
        wait_for_bitcoind_start(bitcoind_processes[i], url, i)
      File "/private/tmp/bitcoin-master/test/functional/test_framework/util.py", line 219, in wait_for_bitcoind_start
        blocks = rpc.getblockcount()
      File "/private/tmp/bitcoin-master/test/functional/test_framework/coverage.py", line 46, in __call__
        return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
      File "/private/tmp/bitcoin-master/test/functional/test_framework/authproxy.py", line 152, in __call__
        response = self._request('POST', self.__url.path, postdata.encode('utf-8'))
      File "/private/tmp/bitcoin-master/test/functional/test_framework/authproxy.py", line 125, in _request
        self.__conn.request(method, path, postdata, headers)
      File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/http/client.py", line 1107, in request
        self._send_request(method, url, body, headers)
      File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/http/client.py", line 1152, in _send_request
        self.endheaders(body)
      File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/http/client.py", line 1103, in endheaders
        self._send_output(message_body)
      File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/http/client.py", line 934, in _send_output
        self.send(msg)
      File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/http/client.py", line 877, in send
        self.connect()
      File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/http/client.py", line 849, in connect
        (self.host,self.port), self.timeout, self.source_address)
      File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/socket.py", line 712, in create_connection
        raise err
      File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/socket.py", line 703, in create_connection
        sock.connect(sa)
    socket.timeout: timed out
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/private/tmp/bitcoin-master/test/functional/test_framework/test_framework.py", line 147, in main
        self.setup_network()
      File "/private/tmp/bitcoin-master/test/functional/test_framework/test_framework.py", line 81, in setup_network
        self.setup_nodes()
      File "/private/tmp/bitcoin-master/test/functional/test_framework/test_framework.py", line 94, in setup_nodes
        self.nodes = start_nodes(self.num_nodes, self.options.tmpdir, extra_args)
      File "/private/tmp/bitcoin-master/test/functional/test_framework/util.py", line 283, in start_nodes
        stop_nodes(rpcs)
      File "/private/tmp/bitcoin-master/test/functional/test_framework/util.py", line 303, in stop_nodes
        assert not bitcoind_processes.values() # All connections must be gone now
    AssertionError
    2017-05-10 08:58:54.017000 TestFramework (INFO): Stopping nodes
    Traceback (most recent call last):
      File "./disconnect_ban.py", line 105, in <module>
        DisconnectBanTest().main()
      File "/private/tmp/bitcoin-master/test/functional/test_framework/test_framework.py", line 163, in main
        self.stop_nodes()
      File "/private/tmp/bitcoin-master/test/functional/test_framework/test_framework.py", line 209, in stop_nodes
        stop_nodes(self.nodes)
      File "/private/tmp/bitcoin-master/test/functional/test_framework/util.py", line 301, in stop_nodes
        for i, node in enumerate(nodes):
    TypeError: 'NoneType' object is not iterable
    

    Ie. the already known and reported issue #9317 (comment), nothing else.

  4. fanquake added the label Tests on May 10, 2017
  5. jnewbery commented at 1:04 PM on May 10, 2017: member

    @paveljanik - can you try running the test when you have a lot of disk access happening in parallel which could block disk i/o for the node under test. One way to do this is to run in parallel with pruning.py which does a lot of stop/starts (and therefore flushes to disk a lot). You can do that by changing the BASE_SCRIPTS list in test_runner to something like:

    BASE_SCRIPTS= [
        'pruning.py',
        'disconnect_ban.py --portseed=1',
        'disconnect_ban.py --portseed=2',
        'disconnect_ban.py --portseed=3',
        'disconnect_ban.py --portseed=4',
    ...
    
  6. MarcoFalke commented at 10:57 AM on May 14, 2017: member

    utACK 3ba2c08980dddb3c109a144a818f23a9188426c3

  7. sipa commented at 6:29 PM on May 14, 2017: member

    Concept ACK

  8. paveljanik commented at 2:12 PM on May 15, 2017: contributor

    I was not able to reproduce, sorry.

    But reading the code, utACK https://github.com/bitcoin/bitcoin/commit/3ba2c08980dddb3c109a144a818f23a9188426c3

  9. MarcoFalke merged this on May 15, 2017
  10. MarcoFalke closed this on May 15, 2017

  11. MarcoFalke referenced this in commit 8bd16ee12f on May 15, 2017
  12. luke-jr referenced this in commit f0eae2d3e9 on Jun 3, 2017
  13. luke-jr referenced this in commit 6c6c074b19 on Jun 3, 2017
  14. luke-jr referenced this in commit d3016c4941 on Jun 5, 2017
  15. luke-jr referenced this in commit ec22e43101 on Jun 5, 2017
  16. luke-jr referenced this in commit cb139aef21 on Jun 15, 2017
  17. PastaPastaPasta referenced this in commit 1138ad0bc1 on Jun 10, 2019
  18. PastaPastaPasta referenced this in commit f8a8ea5ef0 on Jun 11, 2019
  19. PastaPastaPasta referenced this in commit 4b5a722f5d on Jun 11, 2019
  20. PastaPastaPasta referenced this in commit 52bbab749d on Jun 15, 2019
  21. PastaPastaPasta referenced this in commit b50b3ffb7d on Jun 19, 2019
  22. PastaPastaPasta referenced this in commit e1fd569a16 on Jun 19, 2019
  23. PastaPastaPasta referenced this in commit 0b3b8046b3 on Jun 19, 2019
  24. PastaPastaPasta referenced this in commit 834f9e9a35 on Jun 19, 2019
  25. PastaPastaPasta referenced this in commit 1361028bd2 on Jun 19, 2019
  26. PastaPastaPasta referenced this in commit f6dadddaa0 on Jun 20, 2019
  27. PastaPastaPasta referenced this in commit 82047af12b on Jun 22, 2019
  28. PastaPastaPasta referenced this in commit c2b1f2a671 on Jun 22, 2019
  29. PastaPastaPasta referenced this in commit 5bd5b19bd7 on Jun 22, 2019
  30. PastaPastaPasta referenced this in commit eb9a695488 on Jun 22, 2019
  31. PastaPastaPasta referenced this in commit a30c144c2e on Jun 22, 2019
  32. PastaPastaPasta referenced this in commit b6b486c274 on Jun 26, 2019
  33. UdjinM6 referenced this in commit a632ed5c79 on Jul 4, 2019
  34. PastaPastaPasta referenced this in commit de33753f06 on Jul 5, 2019
  35. barrystyle referenced this in commit 278cdf771c on Jan 22, 2020
  36. barrystyle referenced this in commit 77c10333d0 on Jan 22, 2020
  37. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-30 12:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me