Skip to content

Commit 3cb85e0

Browse files
committed
Mark purgeCacheInPackageDirectory withKnowIssue for AL2 (#9386)
- this test seems to cause a crash in libcrypto rdar://134238535
1 parent 84b3e6e commit 3cb85e0

File tree

1 file changed

+47
-41
lines changed

1 file changed

+47
-41
lines changed

Tests/CommandsTests/PackageCommandTests.swift

Lines changed: 47 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -3070,7 +3070,7 @@ struct PackageCommandTests {
30703070
data: BuildData,
30713071
) async throws {
30723072
try await withKnownIssue(
3073-
isIntermittent: ProcessInfo.isHostAmazonLinux2() //rdar://134238535
3073+
isIntermittent: ProcessInfo.isHostAmazonLinux2() // rdar://134238535
30743074
) {
30753075
// Create a temporary directory without Package.swift
30763076
try await fixture(name: "Miscellaneous") { fixturePath in
@@ -3101,57 +3101,63 @@ struct PackageCommandTests {
31013101
func purgeCacheInPackageDirectory(
31023102
data: BuildData,
31033103
) async throws {
3104-
// Test that purge-cache works in a package directory and successfully purges caches
3105-
try await fixture(name: "DependencyResolution/External/Simple") { fixturePath in
3106-
let packageRoot = fixturePath.appending("Bar")
3104+
try await withKnownIssue(
3105+
isIntermittent: ProcessInfo.isHostAmazonLinux2() // rdar://134238535
3106+
) {
3107+
// Test that purge-cache works in a package directory and successfully purges caches
3108+
try await fixture(name: "DependencyResolution/External/Simple") { fixturePath in
3109+
let packageRoot = fixturePath.appending("Bar")
31073110

3108-
// Use a unique temporary cache directory for this test
3109-
try await withTemporaryDirectory(removeTreeOnDeinit: true) { tempDir in
3110-
let cacheDir = tempDir.appending("test-cache")
3111-
let cacheArgs = ["--cache-path", cacheDir.pathString]
3111+
// Use a unique temporary cache directory for this test
3112+
try await withTemporaryDirectory(removeTreeOnDeinit: true) { tempDir in
3113+
let cacheDir = tempDir.appending("test-cache")
3114+
let cacheArgs = ["--cache-path", cacheDir.pathString]
31123115

3113-
// Resolve dependencies to populate cache
3114-
// Note: This fixture uses local dependencies, so only manifest cache will be populated
3115-
try await executeSwiftPackage(
3116-
packageRoot,
3117-
configuration: data.config,
3118-
extraArgs: ["resolve"] + cacheArgs,
3119-
buildSystem: data.buildSystem
3120-
)
3116+
// Resolve dependencies to populate cache
3117+
// Note: This fixture uses local dependencies, so only manifest cache will be populated
3118+
try await executeSwiftPackage(
3119+
packageRoot,
3120+
configuration: data.config,
3121+
extraArgs: ["resolve"] + cacheArgs,
3122+
buildSystem: data.buildSystem
3123+
)
31213124

3122-
// Verify manifest cache was populated
3123-
let manifestsCache = cacheDir.appending(components: "manifests")
3124-
expectDirectoryExists(at: manifestsCache)
3125+
// Verify manifest cache was populated
3126+
let manifestsCache = cacheDir.appending(components: "manifests")
3127+
expectDirectoryExists(at: manifestsCache)
31253128

3126-
// Check for manifest.db file (main database file)
3127-
let manifestDB = manifestsCache.appending("manifest.db")
3128-
let hasManifestDB = localFileSystem.exists(manifestDB)
3129+
// Check for manifest.db file (main database file)
3130+
let manifestDB = manifestsCache.appending("manifest.db")
3131+
let hasManifestDB = localFileSystem.exists(manifestDB)
31293132

3130-
// Check for SQLite auxiliary files that might exist
3131-
let manifestDBWAL = manifestsCache.appending("manifest.db-wal")
3132-
let manifestDBSHM = manifestsCache.appending("manifest.db-shm")
3133-
let hasAuxFiles = localFileSystem.exists(manifestDBWAL) || localFileSystem.exists(manifestDBSHM)
3133+
// Check for SQLite auxiliary files that might exist
3134+
let manifestDBWAL = manifestsCache.appending("manifest.db-wal")
3135+
let manifestDBSHM = manifestsCache.appending("manifest.db-shm")
3136+
let hasAuxFiles = localFileSystem.exists(manifestDBWAL) || localFileSystem.exists(manifestDBSHM)
31343137

3135-
// At least one manifest database file should exist
3136-
#expect(hasManifestDB || hasAuxFiles, "Manifest cache should be populated after resolve")
3138+
// At least one manifest database file should exist
3139+
#expect(hasManifestDB || hasAuxFiles, "Manifest cache should be populated after resolve")
31373140

3138-
// Run purge-cache
3139-
let result = try await executeSwiftPackage(
3140-
packageRoot,
3141-
configuration: data.config,
3142-
extraArgs: ["purge-cache"] + cacheArgs,
3143-
buildSystem: data.buildSystem
3144-
)
3141+
// Run purge-cache
3142+
let result = try await executeSwiftPackage(
3143+
packageRoot,
3144+
configuration: data.config,
3145+
extraArgs: ["purge-cache"] + cacheArgs,
3146+
buildSystem: data.buildSystem
3147+
)
31453148

3146-
// Verify command succeeded
3147-
#expect(!result.stderr.contains("Could not find Package.swift"))
3149+
// Verify command succeeded
3150+
#expect(!result.stderr.contains("Could not find Package.swift"))
31483151

3149-
// Verify manifest.db was removed (the purge implementation removes this file)
3150-
expectFileDoesNotExists(at: manifestDB, "manifest.db should be removed after purge")
3152+
// Verify manifest.db was removed (the purge implementation removes this file)
3153+
expectFileDoesNotExists(at: manifestDB, "manifest.db should be removed after purge")
31513154

3152-
// Note: SQLite auxiliary files (WAL/SHM) may or may not be removed depending on SQLite state
3153-
// The important check is that the main database file is removed
3155+
// Note: SQLite auxiliary files (WAL/SHM) may or may not be removed depending on SQLite state
3156+
// The important check is that the main database file is removed
3157+
}
31543158
}
3159+
} when: {
3160+
ProcessInfo.isHostAmazonLinux2()
31553161
}
31563162
}
31573163

0 commit comments

Comments
 (0)