Skip to content

Conversation

@practicalswift
Copy link
Contributor

@practicalswift practicalswift commented Apr 15, 2021

Remove intermittently failing and not very meaningful BOOST_CHECK in cnetaddr_basic.

Fixes #21682.

Rationale from #21682 (comment):

I've looked at that test before and I don't think that specific BOOST_CHECK makes much sense TBH :)

1.) I don't understand why we test if ToString() output includes %zone_index: it clearly doesn't on some platforms, so we cannot rely on it anyways. Then why test it?

2.) And perhaps more fundamentally: why would we even want to have %zone_index in our textual ToString() output? I think the expectation is to get say fe80::1ff:fe23:4567:890a (without zone index) and not say fe80::1ff:fe23:4567:890a%eth2 or fe80::1ff:fe23:4567:890a%3 when doing ipv6_addr.ToString() :)

@DrahtBot
Copy link
Contributor

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@jonatack
Copy link
Member

@practicalswift Thank you for your concerns that have been helpful. I've updated #21690 to fix the new issue and make the scoped addr assertion be per-platform (macOS, and all others). I hope it addresses your feedback to make the coverage more meaningful.

@jonatack
Copy link
Member

jonatack commented Apr 15, 2021

(Whether it's better now or not, thanks to your feedback, you made me improve it more than I would have done otherwise and that is a good thing.)

@maflcko
Copy link
Member

maflcko commented Apr 17, 2021

review ACK 63631be

I don't have any background in ip addresses, but it seems fine to remove a recently added test that intermittently fails. Looks like #21690 reworks the test. That pull can land after rebase+review.

@maflcko maflcko merged commit f5e8bcf into bitcoin:master Apr 17, 2021
@jonatack
Copy link
Member

Note that the test was added seven months ago and no issues reported until this week.

Re-working the test was not needed to fix this issue. It was only done in reponse to extraneous, new feedback unrelated to the issue.

@maflcko
Copy link
Member

maflcko commented Apr 17, 2021

I am seeing intermittent issues for years that are still waiting for someone to report an issue on. So a lack of a report doesn't imply the issue didn't exist when it was introduced.

@jonatack
Copy link
Member

jonatack commented Apr 17, 2021

Sure, but the fix I proposed was a smaller change than this one (two lines changed, one of which was a comment) and did not drop coverage and context. I tried to improve things constructively. Well, I tried.

sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Apr 17, 2021
… meaningful `BOOST_CHECK` in `cnetaddr_basic`

63631be test: Remove intermittently failing and not very meaningful `BOOST_CHECK` in `cnetaddr_basic` (practicalswift)

Pull request description:

  Remove intermittently failing and not very meaningful `BOOST_CHECK` in `cnetaddr_basic`.

  Fixes bitcoin#21682.

  Rationale from bitcoin#21682 (comment):

  > I've looked at that test before and I don't think that specific `BOOST_CHECK` makes much sense TBH :)
  >
  > 1.) I don't understand why we test if `ToString()` output includes `%zone_index`: it clearly doesn't on some platforms, so we cannot rely on it anyways. Then why test it?
  >
  > 2.) And perhaps more fundamentally: why would we even _want_ to have `%zone_index` in our textual `ToString()` output? I think the expectation is to get say `fe80::1ff:fe23:4567:890a` (without zone index) and not say `fe80::1ff:fe23:4567:890a%eth2 ` or `fe80::1ff:fe23:4567:890a%3 `when doing `ipv6_addr.ToString()` :)

ACKs for top commit:
  MarcoFalke:
    review ACK 63631be

Tree-SHA512: 06863d1edfb9ad1ca9bcae09cf3f0f47b58bb29d222b70799c3dc059b96452889026e4b99b132782846d9896e3e798d17c7f9406e0e6a0bec1bffc6edb54e9df
BOOST_CHECK(!addr.IsBindAny());
const std::string addr_str{addr.ToString()};
BOOST_CHECK(addr_str == scoped_addr || addr_str == "fe80:0:0:0:0:0:0:1");
// The fallback case "fe80:0:0:0:0:0:0:1" is needed for macOS 10.14/10.15 and (probably) later.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change orphaned the documentation in line 303. Fixed in #21961.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

5 participants