aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzerafachris <christopher.zerafa@blocklabs.io>2026-07-21 08:54:23 +0200
committerzerafachris <christopher.zerafa@blocklabs.io>2026-07-21 08:54:23 +0200
commit299810a4a9cbf5a7704c9257796b44f5a5f17720 (patch)
tree4532668d4e82416ec4683669246ecf900e95b7d1
parent557b14e33ea8707ebae39b141d003d46141d6f5f (diff)
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.
-rw-r--r--tests/Jellyfin.Server.Implementations.Tests/FullSystemBackup/BackupServiceTests.cs6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/Jellyfin.Server.Implementations.Tests/FullSystemBackup/BackupServiceTests.cs b/tests/Jellyfin.Server.Implementations.Tests/FullSystemBackup/BackupServiceTests.cs
index e868b8c9a5..66c392a6ad 100644
--- a/tests/Jellyfin.Server.Implementations.Tests/FullSystemBackup/BackupServiceTests.cs
+++ b/tests/Jellyfin.Server.Implementations.Tests/FullSystemBackup/BackupServiceTests.cs
@@ -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);