Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 331567 - IPAccessHandlerTest.java fails consistently on MacOS
Summary: IPAccessHandlerTest.java fails consistently on MacOS
Status: RESOLVED FIXED
Alias: None
Product: Jetty
Classification: RT
Component: server (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 minor (vote)
Target Milestone: 7.1.x   Edit
Assignee: Greg Wilkins CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-01 11:56 EST by Thomas Becker CLA
Modified: 2010-12-02 03:08 EST (History)
1 user (show)

See Also:
gregw: iplog+


Attachments
fix (1.33 KB, patch)
2010-12-01 12:01 EST, Thomas Becker CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Becker CLA 2010-12-01 11:56:53 EST
Build Identifier: 

On MacOS IPAccessHandler resolves localhost to the real network device if there's a network connection.

Even if the connection is setup like this:

Socket socket = new Socket("localhost", _connector.getLocalPort());

One would expect that localhost will be mapped to the loopback ip 127.0.0.1, but MacOS seems to map it to the real IP if a real network connection is established. Test is green when I disable all network connections.

However changing it to: 
Socket socket = new Socket("127.0.0.1", _connector.getLocalPort());

fixes the issue. 

Reproducible: Always

Steps to Reproduce:
1. Run IPAccessHandlerTest on MacOS with some wireless connection established.
Comment 1 Thomas Becker CLA 2010-12-01 12:01:51 EST
Created attachment 184276 [details]
fix

Changed "localhost" to "127.0.0.1". Works.
Comment 2 Greg Wilkins CLA 2010-12-01 12:30:57 EST
patch applied r2566
thanks
Comment 3 Thomas Becker CLA 2010-12-02 03:08:39 EST
thx Greg