Skip to content
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

Remove temp directories after tests #2690

Merged
merged 1 commit into from
Mar 25, 2024
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
12 changes: 12 additions & 0 deletions Tests/NIOFileSystemIntegrationTests/FileHandleTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,10 @@ final class FileHandleTests: XCTestCase {

func testWriteAndReadUnseekableFile() async throws {
let privateTempDirPath = try await FileSystem.shared.createTemporaryDirectory(template: "test-XXX")
self.addTeardownBlock {
try await FileSystem.shared.removeItem(at: privateTempDirPath, recursively: true)
}

guard mkfifo(privateTempDirPath.appending("fifo").string, 0o644) == 0 else {
XCTFail("Error calling mkfifo.")
return
Expand All @@ -321,6 +325,10 @@ final class FileHandleTests: XCTestCase {

func testWriteAndReadUnseekableFileOverMaximumSizeAllowedThrowsError() async throws {
let privateTempDirPath = try await FileSystem.shared.createTemporaryDirectory(template: "test-XXX")
self.addTeardownBlock {
try await FileSystem.shared.removeItem(at: privateTempDirPath, recursively: true)
}

guard mkfifo(privateTempDirPath.appending("fifo").string, 0o644) == 0 else {
XCTFail("Error calling mkfifo.")
return
Expand All @@ -341,6 +349,10 @@ final class FileHandleTests: XCTestCase {

func testWriteAndReadUnseekableFileWithOffsetsThrows() async throws {
let privateTempDirPath = try await FileSystem.shared.createTemporaryDirectory(template: "test-XXX")
self.addTeardownBlock {
try await FileSystem.shared.removeItem(at: privateTempDirPath, recursively: true)
}

guard mkfifo(privateTempDirPath.appending("fifo").string, 0o644) == 0 else {
XCTFail("Error calling mkfifo.")
return
Expand Down