From 8bca101e55dba1c73255f844a56e473ca6324baa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Trzci=C5=84ski?= Date: Wed, 14 Oct 2020 11:08:18 +0200 Subject: [PATCH] Add a sleep to ensure that cache item is evicted --- internal/vfs/zip/vfs_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/vfs/zip/vfs_test.go b/internal/vfs/zip/vfs_test.go index a795b214e..c12e49cd1 100644 --- a/internal/vfs/zip/vfs_test.go +++ b/internal/vfs/zip/vfs_test.go @@ -118,6 +118,7 @@ func TestVFSFindOrCreateArchiveCacheEvict(t *testing.T) { // inject into cache to be "expired" // (we could as well wait `defaultCacheExpirationInterval`) vfs.cache.Set(path, archive, time.Nanosecond) + time.Sleep(time.Nanosecond) // a new object is created archive2, err := vfs.findOrOpenArchive(context.Background(), path) -- GitLab