Skip to content

Commit e80678b

Browse files
committed
Place a time limit on TestFileHandle.test_readWriteHandlers()
This test seems to sometimes fail, which can make it hang forever. Give it a still-generous-but-not-infinite timeout so it at least fails gracefully when it fails. https://bugs.swift.org/browse/SR-10680
1 parent b4291ba commit e80678b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

TestFoundation/TestFileHandle.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ class TestFileHandle : XCTestCase {
488488
try? handle.write(contentsOf: self.content)
489489
}
490490

491-
let result = semaphore.wait(timeout: .distantFuture)
491+
let result = semaphore.wait(timeout: .now() + .seconds(30))
492492
XCTAssertEqual(result, .success, "Waiting on the semaphore should not have had time to time out")
493493
XCTAssertTrue(notificationReceived, "Notification should be sent")
494494
}

0 commit comments

Comments
 (0)