Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When IPv6 is enabled on my computer, half a minute passed between starting a new JUnit process and the test tree appearing in the JUnit view.

When I disable IPv6, the tests appear immediately.

What I see is that the process is created and then hangs ca. 30s in SocketImpl.connect(). With netstat, I can see a line like this:

tcp6       0      1 fe80::xxxx:xxxx:x:51019 ::1:48469               SYN_SENT

Why does that happen?

share|improve this question
add comment

1 Answer

One possibility:

The runner process is listening only on 127.0.0.1, the IPv4 loopback address, but Eclipse is trying to connect to localhost – which can be either 127.0.0.1 or ::1, the latter being IPv6 loopback. On most operating systems, IPv6 is enabled, it will be preferred, causing Eclipse to try IPv6 ::1 first.

Since JUnitRunner is not listening on any IPv6 address, the OS should reject attempted connections with a TCP RST (or mayyybe ICMP "Port Unreachable" if properly firewalled). However, you probably have a firewall configuration that is silently dropping such attempts, which means the client (Eclipse) will be waiting for a reply that is never sent.

First check your firewall configuration (ip6tables) – there is no reason for it to block loopback connections in any way. Test with the firewall temporarily disabled. If nothing helps, check if Eclipse can be configured to use 127.0.0.1, or if JUnit can be configured to listen on both IPv6 and IPv4.

share|improve this answer
    
:-/ The netstat line above says Eclipse isn't trying to use loopback at all. –  Aaron Digulla May 10 '12 at 12:27
    
@AaronDigulla: But ::1 is IPv6 loopback. –  grawity May 10 '12 at 12:31
    
Ah! I completely missed the right side. Why isn't it showing "::1:51019 ::1:48469"? –  Aaron Digulla May 10 '12 at 12:33
    
I checked with ip6tables: There are no rules and all three chains have the policy "ACCEPT" –  Aaron Digulla May 10 '12 at 12:34
    
Hmm, I don't know why it is showing a fe80: address. Does ping6 ::1 reach loopback correctly? –  grawity May 10 '12 at 12:45
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.