Skip to content

Commit

Permalink
Merge #6273: backport: merge bitcoin#27015 (resolve flaky addrman uni…
Browse files Browse the repository at this point in the history
…t test)

925870d merge bitcoin#27015: bitcoin#26847 fixups (AddrMan totals) (Kittywhiskers Van Gogh)

Pull request description:

  ## Additional Information

  As part of [dash#6254](#6254), [bitcoin#26847](bitcoin#26847) was backported and since then, it was observed that unit tests were flakier than expected ([build](https://gitlab.com/dashpay/dash/-/jobs/7811041841), [build](https://gitlab.com/dashpay/dash/-/jobs/7802460298)).

  The flakiness was caused by behavior introduced by the aforementioned backport, this was resolved upstream with [bitcoin#27015](bitcoin#27015), which this pull request contains.

  ## Breaking Changes

  None observed.

  ## Checklist:

  - [x] I have performed a self-review of my own code
  - [x] I have commented my code, particularly in hard-to-understand areas **(note: N/A)**
  - [x] I have added or updated relevant unit/integration/functional/e2e tests
  - [x] I have made corresponding changes to the documentation **(note: N/A)**
  - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_

ACKs for top commit:
  UdjinM6:
    utACK 925870d
  knst:
    ACK 925870d

Tree-SHA512: 20fc8fb1b162803a71ec4087685460f52ed56c3c86d46ecac4cc0ef59c95b4b6206f0c53bef256242a4a5babb76e3564cfba56a84cbe844e187035de2308b818
  • Loading branch information
PastaPastaPasta committed Sep 15, 2024
2 parents 17110f5 + 925870d commit d290df3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion src/addrman.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class AddrMan
* @param[in] in_new Select addresses only from one table (true = new, false = tried, nullopt = both)
* @return Number of unique addresses that match specified options.
*/
size_t Size(std::optional<Network> net = {}, std::optional<bool> in_new = {}) const;
size_t Size(std::optional<Network> net = std::nullopt, std::optional<bool> in_new = std::nullopt) const;

/**
* Attempt to add one or more addresses to addrman's new table.
Expand Down
2 changes: 0 additions & 2 deletions src/test/addrman_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1035,8 +1035,6 @@ BOOST_AUTO_TEST_CASE(load_addrman_corrupted)
} catch (const std::exception&) {
exceptionThrown = true;
}
// Even though de-serialization failed addrman is not left in a clean state.
BOOST_CHECK(addrman1.Size() == 1);
BOOST_CHECK(exceptionThrown);

// Test that ReadFromStream fails if peers.dat is corrupt
Expand Down

0 comments on commit d290df3

Please sign in to comment.