test/functional/test_runner.py wallet_listtransactions.py fails when run individually #14732

issue kristapsk opened this issue on November 15, 2018
  1. kristapsk commented at 10:27 PM on November 15, 2018: contributor

    When I run complete functional tests using test/functional/test_runner.py, all tests pass. Also, when I run test/functional/wallet_listtransactions.py individually, it is successfull.

    $ test/functional/wallet_listtransactions.py 
    2018-11-15T22:08:25.288000Z TestFramework (INFO): Initializing test directory /tmp/test60gysa60
    2018-11-15T22:08:51.034000Z TestFramework (INFO): Stopping nodes
    2018-11-15T22:08:51.998000Z TestFramework (INFO): Cleaning up /tmp/test60gysa60 on exit
    2018-11-15T22:08:51.998000Z TestFramework (INFO): Tests successful
    

    But when I run test/functional/test_runner.py wallet_listtransactions.py, it always fails with the "AssertionError: Mempool sync timed out".

    $ LC_ALL=lv_LV.UTF-8 test/functional/test_runner.py wallet_listtransactions.py
    Temporary test directory at /tmp/test_runner_₿_🏃_20181116_001822
    WARNING! There is already a bitcoind process running on this system. Tests may fail unexpectedly due to resource contention!
    1/1 - wallet_listtransactions.py failed, Duration: 84 s                                                                                                                 
    
    stdout:
    2018-11-15T22:18:22.640000Z TestFramework (INFO): Initializing test directory /tmp/test_runner_₿_🏃_20181116_001822/wallet_listtransactions_0
    2018-11-15T22:19:45.625000Z TestFramework (ERROR): Assertion failed
    Traceback (most recent call last):
      File "XXX/bitcoin/test/functional/test_framework/test_framework.py", line 171, in main
        self.run_test()
      File "XXX/bitcoin/test/functional/wallet_listtransactions.py", line 36, in run_test
        self.sync_all()
      File "XXX/bitcoin/test/functional/test_framework/test_framework.py", line 372, in sync_all
        sync_mempools(group)
      File "XXX/bitcoin/test/functional/test_framework/util.py", line 408, in sync_mempools
        raise AssertionError("Mempool sync timed out:{}".format("".join("\n  {!r}".format(m) for m in pool)))
    AssertionError: Mempool sync timed out:
      {'88a5f9e47a8617c29eb2330d06cb8af84e30dbcf8276c018b522af9d2cfbf297'}
      set()
    2018-11-15T22:19:45.682000Z TestFramework (INFO): Stopping nodes
    2018-11-15T22:19:46.646000Z TestFramework (WARNING): Not cleaning up dir /tmp/test_runner_₿_🏃_20181116_001822/wallet_listtransactions_0
    2018-11-15T22:19:46.646000Z TestFramework (ERROR): Test failed. Test logging available at /tmp/test_runner_₿_🏃_20181116_001822/wallet_listtransactions_0/test_framework.log
    2018-11-15T22:19:46.648000Z TestFramework (ERROR): Hint: Call XXX/bitcoin/test/functional/combine_logs.py '/tmp/test_runner_₿_🏃_20181116_001822/wallet_listtransactions_0' to consolidate all logs
    
    
    stderr:
    
    
    
    TEST                       | STATUS    | DURATION
    
    wallet_listtransactions.py | ✖ Failed  | 84 s
    
    ALL                        | ✖ Failed  | 84 s (accumulated) 
    Runtime: 84 s
    

    Looked at logs mentioned in output, but could not find anything suspicous there.

    Is it a bug or feature? :) Any ideas?

    It is with current master.

  2. MarcoFalke commented at 3:39 AM on November 16, 2018: member

    This is a weird interaction when not creating the cache with the listtransactions script (test runner running all scripts or running script by hand) vs creating the cache with the listtransactions script (test runner running only the listtransactions script). Creating the cache with the listtransactions script would disable mocktime, whereas it should stay enabled.

    Simple fix:

    diff --git a/test/functional/wallet_listtransactions.py b/test/functional/wallet_listtransactions.py
    index 8ca0387268..3fb25b1382 100755
    --- a/test/functional/wallet_listtransactions.py
    +++ b/test/functional/wallet_listtransactions.py
    @@ -22,15 +22,17 @@ def tx_from_hex(hexstring):
         tx.deserialize(f)
         return tx
     
    +
     class ListTransactionsTest(BitcoinTestFramework):
         def set_test_params(self):
             self.num_nodes = 2
    -        self.enable_mocktime()
     
         def skip_test_if_missing_module(self):
             self.skip_if_no_wallet()
     
         def run_test(self):
    +        self.nodes[0].generate(1)  # Get out of IBD
    +        self.sync_all()
             # Simple send, 0 to 1:
             txid = self.nodes[0].sendtoaddress(self.nodes[1].getnewaddress(), 0.1)
             self.sync_all()
    
  3. MarcoFalke added the label Tests on Nov 16, 2018
  4. MarcoFalke added the label good first issue on Nov 16, 2018
  5. kristapsk referenced this in commit 364a8773c0 on Nov 16, 2018
  6. kristapsk referenced this in commit 8f4bd562cd on Nov 16, 2018
  7. kristapsk referenced this in commit 2474de0265 on Nov 16, 2018
  8. MarcoFalke referenced this in commit 96d912bea8 on Dec 29, 2018
  9. MarcoFalke closed this on Dec 29, 2018

  10. HashUnlimited referenced this in commit 1f37b79e95 on Jan 8, 2019
  11. kallewoof referenced this in commit 66c015529e on Oct 4, 2019
  12. DrahtBot locked this on Sep 8, 2021
  13. Munkybooty referenced this in commit 3227d623c4 on Feb 3, 2022
  14. Munkybooty referenced this in commit 1373a9b840 on Feb 4, 2022
  15. Munkybooty referenced this in commit 0435f98e7b on Feb 24, 2022
  16. Munkybooty referenced this in commit b9c7345cc5 on Mar 6, 2022
  17. Munkybooty referenced this in commit 3b6848afd4 on Mar 8, 2022

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-14 18:15 UTC

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