Skip to content

Commit beec3f4

Browse files
authored
Merge pull request #2687 from spevans/pr_sr_10512
SR-10512: TestFileManager .creationDate failed on Ubuntu 14.04
2 parents 9ff70fe + 1756842 commit beec3f4

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

Tests/Foundation/Tests/TestFileManager.swift

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -335,21 +335,11 @@ class TestFileManager : XCTestCase {
335335
let fileGroupOwnerAccountID = attrs[.groupOwnerAccountID] as? NSNumber
336336
XCTAssertNotNil(fileGroupOwnerAccountID)
337337

338-
#if os(Linux)
339-
/* ⚠️ */
340-
if shouldAttemptXFailTests("Checking that .creationDate is set is failing on Ubuntu 16.04 when running from a Docker image. https://bugs.swift.org/browse/SR-10512") {
341-
let requiredVersion = OperatingSystemVersion(majorVersion: 4, minorVersion: 11, patchVersion: 0)
342-
let creationDate = attrs[.creationDate] as? Date
343-
if ProcessInfo.processInfo.isOperatingSystemAtLeast(requiredVersion) {
344-
XCTAssertNotNil(creationDate)
345-
XCTAssertGreaterThan(Date().timeIntervalSince1970, try XCTUnwrap(creationDate).timeIntervalSince1970)
346-
} else {
347-
XCTAssertNil(creationDate)
348-
}
338+
// .creationDate is not not available on all systems but if it is supported check the value is reasonable
339+
if let creationDate = attrs[.creationDate] as? Date {
340+
XCTAssertGreaterThan(Date().timeIntervalSince1970, creationDate.timeIntervalSince1970)
349341
}
350-
/* ⚠️ */
351-
#endif
352-
342+
353343
if let fileOwnerAccountName = attrs[.ownerAccountName] {
354344
XCTAssertNotNil(fileOwnerAccountName as? String)
355345
if let fileOwnerAccountNameStr = fileOwnerAccountName as? String {

0 commit comments

Comments
 (0)