fix: use build output directory for backup test temp root to avoid low free-space failures on Windows CI runners
BackupServiceTests rooted its temp directory under Path.GetTempPath(), which on GitHub-hosted windows-latest runners resolves to the constrained system C: drive. BackupService.CreateBackupAsync requires 5GiB free at the backup path before starting, and the C: drive's free temp space can dip below that, failing CreateBackupAsync_WithCorruptKeyframeDataRow_SkipsRowAndCompletesBackup even though the fix itself is correct. Rooting the test directory under AppContext.BaseDirectory keeps it on the same (much larger) drive as the repo checkout on all platforms, without touching the real BackupService free-space check.
This commit is contained in:
@@ -50,7 +50,11 @@ public sealed class BackupServiceTests : IDisposable
|
||||
ctx.Database.EnsureCreated();
|
||||
}
|
||||
|
||||
_testRoot = Path.Combine(Path.GetTempPath(), "jellyfin-backup-service-tests-" + Guid.NewGuid().ToString("N"));
|
||||
// Use the test assembly's own output directory instead of Path.GetTempPath(). On GitHub-hosted
|
||||
// windows-latest runners, the system temp directory lives on the constrained C: drive, which can have
|
||||
// less than the 5GiB BackupService requires free, causing spurious failures. AppContext.BaseDirectory
|
||||
// is under the repo checkout (the much larger D: drive on Windows runners) on all platforms.
|
||||
_testRoot = Path.Combine(AppContext.BaseDirectory, "jellyfin-backup-service-tests-" + Guid.NewGuid().ToString("N"));
|
||||
_backupPath = Path.Combine(_testRoot, "Backup");
|
||||
_configurationDirectoryPath = Path.Combine(_testRoot, "Config");
|
||||
Directory.CreateDirectory(_backupPath);
|
||||
|
||||
Reference in New Issue
Block a user