aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorCody Robibero <cody@robibe.ro>2025-03-27 18:16:54 -0600
committerGitHub <noreply@github.com>2025-03-27 18:16:54 -0600
commit88ceaa39b0347c7b7626d38a48baa64923c66eeb (patch)
tree89e09f1095f11168d1bd5bf81a98f9366eed186b /tests
parente9331fe9d73469bb04ae549ceaa9ea6f1ed7aa6a (diff)
Implement limiting caches (#13605)
* Implement basic expiring cache for LibraryManager * Add expiring cache to more places * Rider why * Make DirectoryService caches static * Use FastConcurrentLru * Reduce default cache size * Simplify DirectoryService caches * Make directory service cache size at least 128
Diffstat (limited to 'tests')
-rw-r--r--tests/Jellyfin.Controller.Tests/DirectoryServiceTests.cs8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/Jellyfin.Controller.Tests/DirectoryServiceTests.cs b/tests/Jellyfin.Controller.Tests/DirectoryServiceTests.cs
index 07b53bf74..9e7a8c844 100644
--- a/tests/Jellyfin.Controller.Tests/DirectoryServiceTests.cs
+++ b/tests/Jellyfin.Controller.Tests/DirectoryServiceTests.cs
@@ -181,8 +181,8 @@ namespace Jellyfin.Controller.Tests
fileSystemMock.Setup(f => f.GetFileSystemInfo(It.Is<string>(x => x == path))).Returns(newFileSystemMetadata);
var secondResult = directoryService.GetFile(path);
- Assert.Equal(cachedFileSystemMetadata, result);
- Assert.Equal(cachedFileSystemMetadata, secondResult);
+ Assert.Equivalent(cachedFileSystemMetadata, result);
+ Assert.Equivalent(cachedFileSystemMetadata, secondResult);
}
[Fact]
@@ -209,7 +209,7 @@ namespace Jellyfin.Controller.Tests
fileSystemMock.Setup(f => f.GetFilePaths(It.Is<string>(x => x == path), false)).Returns(cachedPaths);
var directoryService = new DirectoryService(fileSystemMock.Object);
- var result = directoryService.GetFilePaths(path);
+ var result = directoryService.GetFilePaths(path, true);
fileSystemMock.Setup(f => f.GetFilePaths(It.Is<string>(x => x == path), false)).Returns(newPaths);
var secondResult = directoryService.GetFilePaths(path);
@@ -241,7 +241,7 @@ namespace Jellyfin.Controller.Tests
fileSystemMock.Setup(f => f.GetFilePaths(It.Is<string>(x => x == path), false)).Returns(cachedPaths);
var directoryService = new DirectoryService(fileSystemMock.Object);
- var result = directoryService.GetFilePaths(path);
+ var result = directoryService.GetFilePaths(path, true);
fileSystemMock.Setup(f => f.GetFilePaths(It.Is<string>(x => x == path), false)).Returns(newPaths);
var secondResult = directoryService.GetFilePaths(path, true);