Skip to content

Commit

Permalink
Fix last remaining test on Android
Browse files Browse the repository at this point in the history
Motivation

Get all tests passing on Android AArch64

Modifications

- Use the right localhost alias for BootstrapTest/testClientBindWorksOnSocketsBoundToEitherIPv4OrIPv6Only

Result

All tests pass natively on Android AArch64
  • Loading branch information
finagolfin committed Jul 2, 2023
1 parent 60c54a7 commit 6f1abf6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Tests/NIOPosixTests/BootstrapTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -644,10 +644,15 @@ class BootstrapTest: XCTestCase {

var maybeChannel1: Channel? = nil
// Try 2: Connect to "localhost", this will do Happy Eyeballs.
#if canImport(Darwin)
let localhost = "localhost"
#else
let localhost = isIPv4 ? "localhost" : "ip6-localhost"
#endif
XCTAssertNoThrow(maybeChannel1 = try ClientBootstrap(group: self.group)
.channelOption(ChannelOptions.socketOption(.so_reuseaddr), value: 1)
.bind(to: clientLocalAddressWholeInterface)
.connect(host: "localhost", port: server1LocalAddress.port!)
.connect(host: localhost, port: server1LocalAddress.port!)
.wait())
guard let myChannel1 = maybeChannel1, let myChannel1Address = myChannel1.localAddress else {
XCTFail("can't connect channel 1")
Expand Down

0 comments on commit 6f1abf6

Please # to comment.