This is an archive of the discontinued LLVM Phabricator instance.

[lldb] [unittest] Avoid mixing '127.0.0.1' and 'localhost'
ClosedPublic

Authored by mgorny on Feb 12 2019, 8:40 AM.

Details

Summary

Fix the tests not to use '127.0.0.1' and 'localhost' interchangeably.
More specifically, since tests bind specifically to 127.0.0.1, connect
to that address as well; using 'localhost' can resolve to IPv6 address
which can cause issues -- for example, if the matching port happens to
be used by some other process, the tests hang forever waiting for
the client to connect.

While technically the case of randomly selected IPv4 port being taken
on IPv6 loopback is not very likely, NetBSD happens to be suffering from
some weird kernel issue where connection to that port succeeds
nevertheless. Until we can really figure out what goes wrong there,
this saves us from the tests hanging randomly.

Diff Detail

Repository
rL LLVM

Event Timeline

mgorny created this revision.Feb 12 2019, 8:40 AM
clayborg accepted this revision.Feb 12 2019, 8:48 AM
clayborg added a subscriber: clayborg.

Yeah localhost can cause problems if someone has a custom mapping in their network config file.

This revision is now accepted and ready to land.Feb 12 2019, 8:48 AM
krytarowski accepted this revision.Feb 12 2019, 9:22 AM

Short term this looks fine.

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 12 2019, 10:08 AM