From d92f4c966206bb3b86bbba30b5c65d7882722a7a Mon Sep 17 00:00:00 2001 From: Kabir Oberai Date: Sun, 15 Nov 2026 19:09:07 -0500 Subject: [PATCH] tests: increase DispatchInput deadline --- Tests/XToolTests/CommandOutputTests.swift | 2 +- Tests/XToolTests/DispatchInputTests.swift | 2 +- Tests/XToolTests/InputTestSupport.swift | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Tests/XToolTests/CommandOutputTests.swift b/Tests/XToolTests/CommandOutputTests.swift index cd0d4f51..e45088f5 100644 --- a/Tests/XToolTests/CommandOutputTests.swift +++ b/Tests/XToolTests/CommandOutputTests.swift @@ -103,7 +103,7 @@ struct CommandOutputTests { // Give the writer time to enter poll before cancelling, without draining the pipe. try await Task.sleep(for: .milliseconds(20)) writing.cancel() - let deadline = ContinuousClock.now.advanced(by: .seconds(2)) + let deadline = ContinuousClock.now.advanced(by: .seconds(30)) while !finished.value && ContinuousClock.now < deadline { try await Task.sleep(for: .milliseconds(10)) } diff --git a/Tests/XToolTests/DispatchInputTests.swift b/Tests/XToolTests/DispatchInputTests.swift index f5adc57e..a327a0ab 100644 --- a/Tests/XToolTests/DispatchInputTests.swift +++ b/Tests/XToolTests/DispatchInputTests.swift @@ -170,7 +170,7 @@ struct DispatchInputTests { } #expect(weakReader == nil) // poll for channel.close() to finish - let deadline = ContinuousClock.now + .seconds(2) + let deadline = ContinuousClock.now + .seconds(30) while fcntl(descriptor.rawValue, F_GETFL) != flags { try #require(ContinuousClock.now < deadline, "Timed out waiting for input operation") try await Task.sleep(for: .milliseconds(1)) diff --git a/Tests/XToolTests/InputTestSupport.swift b/Tests/XToolTests/InputTestSupport.swift index 5b245983..141814bf 100644 --- a/Tests/XToolTests/InputTestSupport.swift +++ b/Tests/XToolTests/InputTestSupport.swift @@ -3,7 +3,7 @@ import Testing /// Releases suspended reads on timeout so a regression cannot hang the test process. func withInputTestTimeout( - _ timeout: Duration = .seconds(5), + _ timeout: Duration = .seconds(30), operation: () async throws -> T, cleanup: @escaping @Sendable () async -> Void, ) async throws -> T {