test: Add addrman peers.dat test #22877

pull MarcoFalke wants to merge 2 commits into bitcoin:master from MarcoFalke:2109-testPeersDat changing 3 files +88 −3
  1. MarcoFalke commented at 1:58 PM on September 3, 2021: member

    No description provided.

  2. MarcoFalke commented at 1:58 PM on September 3, 2021: member
  3. test: Remove useless overwrite facce4ca44
  4. MarcoFalke force-pushed on Sep 3, 2021
  5. in test/functional/feature_addrman.py:61 in fac6844d9f outdated
      56 | +                f'ERROR: DeserializeDB: Deserialize or I/O error - Unsupported format of addrman database: \\x01. It is compatible with formats >=111, but the maximum supported by this version of {self.config["environment"]["PACKAGE_NAME"]} is 3.: iostream error',
      57 | +                'Recreating peers.dat',
      58 | +        ]):
      59 | +            self.start_node(0)
      60 | +
      61 | +        self.log.info("Check that corrupt addrman can not be read")
    


    jonatack commented at 2:28 PM on September 3, 2021:

    nit, s/can not/cannot/ here and line 52


    MarcoFalke commented at 2:43 PM on September 3, 2021:

    Thanks, done

  6. in test/functional/feature_addrman.py:50 in fac6844d9f outdated
      45 | +
      46 | +        self.log.info("Check that mocked addrman is valid")
      47 | +        self.stop_node(0)
      48 | +        write_addrman(peers_dat)
      49 | +        with self.nodes[0].assert_debug_log(['Loaded 0 addresses from peers.dat']):
      50 | +            self.start_node(0)
    


    jonatack commented at 2:33 PM on September 3, 2021:

    run with -checkaddrman

                self.start_node(0, ["-checkaddrman=1"])
    

    can also check that self.nodes[0].getnodeaddresses() is an empty array here and in the last test, to not rely only on the log

    I do both of these in #22831


    MarcoFalke commented at 2:43 PM on September 3, 2021:

    Thanks, done

  7. jonatack commented at 2:34 PM on September 3, 2021: member

    Nice, concept ACK. Some initial ideas below.

  8. in test/functional/feature_addrman.py:75 in fac6844d9f outdated
      66 | +                'ERROR: DeserializeDB: Deserialize or I/O error - CAutoFile::read: end of file: iostream error',
      67 | +                'Recreating peers.dat',
      68 | +        ]):
      69 | +            self.start_node(0)
      70 | +
      71 | +        self.log.info("Check that missing addrman is recreated")
    


    jonatack commented at 2:37 PM on September 3, 2021:

    This is the same as d507068 (#22831)


    MarcoFalke commented at 2:43 PM on September 3, 2021:

    Thanks for the pointer

  9. test: Add addrman peers.dat test fa6cf1740e
  10. MarcoFalke force-pushed on Sep 3, 2021
  11. MarcoFalke commented at 2:44 PM on September 3, 2021: member

    Force pushed to address feedback

  12. jonatack commented at 2:58 PM on September 3, 2021: member

    I wrote some follow-ups last weekend to #22831 to add more addrman tests and rename feature_asmap.py to feature_addrman_asmap.py as they are related features, but didn't want to add them to that pull to keep it focused on just fixing the bug with regression tests.

  13. MarcoFalke commented at 3:36 PM on September 3, 2021: member

    Looks like there is some kind of compiler bug or compiler behaviour change

  14. MarcoFalke closed this on Sep 3, 2021

  15. MarcoFalke commented at 3:42 PM on September 3, 2021: member

    Reported issue in https://github.com/c42f/tinyformat/issues/82, worked around issue in #22879

  16. DrahtBot locked this on Sep 3, 2022
Contributors

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-17 06:14 UTC

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