ss77892 opened a new pull request, #12066:
URL: https://github.com/apache/ozone/pull/12066
## What changes were proposed in this pull request?
`TestOMNodeDetails#testSetRatisAddress` fails intermittently in CI:
```
TestOMNodeDetails.testSetRatisAddress:463
AssertionFailedError: expected: <192.168.1.100> but was:
<ip-192-168-1-100.ec2.internal>
```
The test builds the Ratis address with `new
InetSocketAddress("192.168.1.100", 9873)`, which creates a resolved address.
`OMNodeDetails.Builder#setRatisAddress` takes the host from
`ratisAddr.getHostName()`, and for a resolved address created from an IP
literal, `getHostName()` does a reverse DNS lookup. Some GitHub-hosted runners
(on AWS) answer that lookup with `ip-192-168-1-100.ec2.internal`, so the result
depends on which runner picks up the job.
Fix:
The test now uses `InetSocketAddress.createUnresolved("192.168.1.100",
9873)`. `getHostName()` on an unresolved address returns the given string
without any lookup, so the test no longer depends on the runner's DNS. Only the
test changes; `OMNodeDetails` is unchanged.
## What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-17833
## How was this patch tested?
- `TestOMNodeDetails` passes locally (23 tests, 0 failures).
- Example of the failure in CI before the fix:
https://github.com/ss77892/ozone/actions/runs/43892876037/job/133548147048
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]