[MINOR] Fix flaky test testGetHostIp by izchen · Pull Request #141 · apache/uniffle · GitHub
Skip to content

[MINOR] Fix flaky test testGetHostIp#141

Merged
roryqi merged 1 commit into
apache:masterfrom
izchen:fix_testGetHostIp
Aug 8, 2022
Merged

[MINOR] Fix flaky test testGetHostIp#141
roryqi merged 1 commit into
apache:masterfrom
izchen:fix_testGetHostIp

Conversation

@izchen

@izchen izchen commented Aug 8, 2022

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Do not use InetAddress.getLocalHost().getHostAddress() in test because it is indeterminate. The return value may be different on a multi-NIC machine or on different system.

Why are the changes needed?

In addition to 127.0.0.1, the loopback address 127.0.1.1 can also be returned, which happens on Debian.This will make UT fail.

org.opentest4j.AssertionFailedError: 
Expected :127.0.1.1
Actual   :10.0.191.230

at org.apache.uniffle.common.util.RssUtilsTest.testGetHostIp(RssUtilsTest.java:64)

Does this PR introduce any user-facing change?

No.

How was this patch tested?

UT.

@roryqi roryqi changed the title [Minor] Fix flaky test testGetHostIp [MINOR] Fix flaky test testGetHostIp Aug 8, 2022
@codecov-commenter

codecov-commenter commented Aug 8, 2022

Copy link
Copy Markdown

@roryqi

roryqi commented Aug 8, 2022

Copy link
Copy Markdown
Contributor

Thanks @izchen , wait for GA.

@izchen

izchen commented Aug 8, 2022

Copy link
Copy Markdown
Contributor Author

@roryqi roryqi merged commit 04cbdbb into apache:master Aug 8, 2022
@izchen izchen deleted the fix_testGetHostIp branch August 8, 2022 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants