diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 27b4e67..ef41d4e 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -19,5 +19,5 @@ jobs: steps: - uses: actions/checkout@v1 - name: Setup Xcode - run: sudo xcode-select -s /Applications/Xcode_14.3.1.app + run: sudo xcode-select -s /Applications/Xcode_15.2.0.app - run: make test-${{ matrix.action }} diff --git a/Sources/NTPClient.swift b/Sources/NTPClient.swift index 322146e..8945e30 100644 --- a/Sources/NTPClient.swift +++ b/Sources/NTPClient.swift @@ -157,6 +157,9 @@ final class NTPClient { return } + print(callbackType) + print(data) + guard let info = info else { return } diff --git a/Tests/KronosTests/DNSResolverTests.swift b/Tests/KronosTests/DNSResolverTests.swift index 3db9564..b008830 100644 --- a/Tests/KronosTests/DNSResolverTests.swift +++ b/Tests/KronosTests/DNSResolverTests.swift @@ -5,7 +5,7 @@ final class DNSResolverTests: XCTestCase { func testResolveOneIP() { let expectation = self.expectation(description: "Query host's DNS for a single IP") - DNSResolver.resolve(host: "test.com") { addresses in + DNSResolver.resolve(host: "example.com") { addresses in XCTAssertEqual(addresses.count, 1) expectation.fulfill() } diff --git a/Tests/KronosTests/NTPClientTests.swift b/Tests/KronosTests/NTPClientTests.swift index 646f5e3..6d03599 100644 --- a/Tests/KronosTests/NTPClientTests.swift +++ b/Tests/KronosTests/NTPClientTests.swift @@ -19,7 +19,7 @@ final class NTPClientTests: XCTestCase { } } - self.waitForExpectations(timeout: 10) + self.waitForExpectations(timeout: 20) } func testQueryPool() { @@ -27,7 +27,7 @@ final class NTPClientTests: XCTestCase { NTPClient().query(pool: "0.pool.ntp.org", numberOfSamples: 1, maximumServers: 1) { offset, _, _ in XCTAssertNotNil(offset) - NTPClient().query(pool: "0.pool.ntp.org", numberOfSamples: 1, maximumServers: 1) + NTPClient().query(pool: "0.pool.ntp.org", numberOfSamples: 1, maximumServers: 1, timeout: 20) { offset2, _, _ in XCTAssertNotNil(offset2) XCTAssertLessThan(abs(offset! - offset2!), 0.10) @@ -35,16 +35,17 @@ final class NTPClientTests: XCTestCase { } } - self.waitForExpectations(timeout: 10) + self.waitForExpectations(timeout: 20) } func testQueryPoolWithIPv6() { let expectation = self.expectation(description: "NTPClient queries a pool that supports IPv6") - NTPClient().query(pool: "2.pool.ntp.org", numberOfSamples: 1, maximumServers: 1) { offset, _, _ in + NTPClient().query(pool: "2.pool.ntp.org", numberOfSamples: 1, maximumServers: 1, timeout: 20) + { offset, _, _ in XCTAssertNotNil(offset) expectation.fulfill() } - self.waitForExpectations(timeout: 10) + self.waitForExpectations(timeout: 20) } }