Skip to content

SR-10512: TestFileManager .creationDate failed on Ubuntu 14.04 #2687

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 22, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 4 additions & 14 deletions Tests/Foundation/Tests/TestFileManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -335,21 +335,11 @@ class TestFileManager : XCTestCase {
let fileGroupOwnerAccountID = attrs[.groupOwnerAccountID] as? NSNumber
XCTAssertNotNil(fileGroupOwnerAccountID)

#if os(Linux)
/* ⚠️ */
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") {
let requiredVersion = OperatingSystemVersion(majorVersion: 4, minorVersion: 11, patchVersion: 0)
let creationDate = attrs[.creationDate] as? Date
if ProcessInfo.processInfo.isOperatingSystemAtLeast(requiredVersion) {
XCTAssertNotNil(creationDate)
XCTAssertGreaterThan(Date().timeIntervalSince1970, try XCTUnwrap(creationDate).timeIntervalSince1970)
} else {
XCTAssertNil(creationDate)
}
// .creationDate is not not available on all systems but if it is supported check the value is reasonable
if let creationDate = attrs[.creationDate] as? Date {
XCTAssertGreaterThan(Date().timeIntervalSince1970, creationDate.timeIntervalSince1970)
}
/* ⚠️ */
#endif


if let fileOwnerAccountName = attrs[.ownerAccountName] {
XCTAssertNotNil(fileOwnerAccountName as? String)
if let fileOwnerAccountNameStr = fileOwnerAccountName as? String {
Expand Down