kylemeow commented on a change in pull request #13706:
URL: https://github.com/apache/flink/pull/13706#discussion_r510135283



##########
File path: 
flink-runtime/src/test/java/org/apache/flink/runtime/taskmanager/TaskManagerLocationTest.java
##########
@@ -198,4 +199,18 @@ public void testGetHostname2() {
                        fail(e.getMessage());
                }
        }
+
+       @Test
+       public void testNotRetrieveHostName() {
+               InetAddress address = mock(InetAddress.class);
+               when(address.getCanonicalHostName()).thenReturn("worker10");
+               when(address.getHostName()).thenReturn("worker10");
+               when(address.getHostAddress()).thenReturn("127.0.0.1");

Review comment:
       Hi @tillrohrmann , based on my prior observation, some of the machines 
might not resolve "127.0.0.1" back to "localhost" due to missing `/etc/hosts` 
items or other reasons, so I think we'd better explicitly mock the return value 
to offer more compatibility in various environments.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to