Skip to content

Commit 8677081

Browse files
committed
Experiment: disable hanging tests
1 parent f49864e commit 8677081

2 files changed

Lines changed: 18 additions & 6 deletions

File tree

Sources/SWBTestSupport/SkippedTestSupport.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,8 @@ extension Trait where Self == Testing.ConditionTrait {
172172
}
173173

174174
package static func skipInGitHubActions(_ comment: Comment? = nil) -> Self {
175-
return .skipIfEnvironmentVariableSet(key: "GITHUB_ACTIONS")
175+
//return .skipIfEnvironmentVariableSet(key: "GITHUB_ACTIONS")
176+
disabled("its broke")
176177
}
177178

178179
package static func requireClangFeatures(_ requiredFeatures: DiscoveredClangToolSpecInfo.FeatureFlag...) -> Self {

Tests/SWBTaskExecutionTests/PBXCpTests.swift

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -442,21 +442,32 @@ fileprivate struct PBXCpTests: CoreBasedTests {
442442
fileprivate let buffer0 = [UInt8](repeating: 0xAA, count: 1024 * 513)
443443
fileprivate let buffer1 = [UInt8](repeating: 0x55, count: 1024 * 513)
444444

445-
@Test(.skipHostOS(.windows, "LocalFS needs to use stat64 on windows...."),
446-
.skipInGitHubActions("GitHub action runners do not have enough storage space for this test"))
445+
@Test
447446
func largerFile() async throws {
448-
try await withTemporaryDirectory { tmp in
447+
let iterationCount = 4096
448+
let buffers = buffer0 + buffer1
449+
let requiredSpace = ByteCount(Int64(buffers.count * (iterationCount + 1) * 2 * 2 * 10000))
450+
let fs = localFS
451+
try await withTemporaryDirectory(fs: fs) { tmp in
452+
// If the available free disk space on this filesystem is less than twice the amount of data the test is expected to write (2 copies of the file times 2), skip it
453+
if let freeSpace = try fs.getFreeDiskSpace(tmp), freeSpace < requiredSpace {
454+
withKnownIssue {
455+
Issue.record("There is not enough free disk space to run this test (required: \(requiredSpace), free: \(freeSpace))")
456+
return
457+
}
458+
}
459+
449460
// Test copying a large file.
450461
let src = tmp.join("src")
451462
let sName = src.join("file")
452463
let dst = tmp.join("dst")
453464
let dName = dst.join("file")
454-
let fs = localFS
465+
455466

456467
try fs.createDirectory(src, recursive: true)
457468
var size = 0
458469
try await fs.write(sName) { fd in
459-
for _ in 0...4096 {
470+
for _ in 0...iterationCount {
460471
size += try fd.writeAll(buffer0)
461472
size += try fd.writeAll(buffer1)
462473
}

0 commit comments

Comments
 (0)