From 22f919696004beb861f3ff9037b326cab5079522 Mon Sep 17 00:00:00 2001 From: Justin Harms Date: Tue, 21 Jan 2025 12:27:49 -0600 Subject: [PATCH] enable parallel execution for cache tests --- vfs/cache/cache_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/vfs/cache/cache_test.go b/vfs/cache/cache_test.go index 3f6cb8b..c03368d 100644 --- a/vfs/cache/cache_test.go +++ b/vfs/cache/cache_test.go @@ -15,6 +15,8 @@ func testMemory() vfs.VFS { } func TestNew(t *testing.T) { + t.Parallel() + fast := testMemory() slow := testMemory() @@ -25,6 +27,8 @@ func TestNew(t *testing.T) { } func TestNewPanics(t *testing.T) { + t.Parallel() + defer func() { if r := recover(); r == nil { t.Fatal("expected panic but did not get one") @@ -35,6 +39,8 @@ func TestNewPanics(t *testing.T) { } func TestSetAndGet(t *testing.T) { + t.Parallel() + fast := testMemory() slow := testMemory() cache := New(fast, slow, nil) @@ -57,6 +63,8 @@ func TestSetAndGet(t *testing.T) { } func TestSetAndGetNoFast(t *testing.T) { + t.Parallel() + slow := testMemory() cache := New(nil, slow, nil) @@ -77,6 +85,8 @@ func TestSetAndGetNoFast(t *testing.T) { } } func TestCaching(t *testing.T) { + t.Parallel() + fast := testMemory() slow := testMemory() cache := New(fast, slow, func(fi *vfs.FileInfo, cs cachestate.CacheState) bool { @@ -134,6 +144,8 @@ func TestCaching(t *testing.T) { } func TestGetNotFound(t *testing.T) { + t.Parallel() + fast := testMemory() slow := testMemory() cache := New(fast, slow, nil) @@ -145,6 +157,8 @@ func TestGetNotFound(t *testing.T) { } func TestDelete(t *testing.T) { + t.Parallel() + fast := testMemory() slow := testMemory() cache := New(fast, slow, nil) @@ -167,6 +181,8 @@ func TestDelete(t *testing.T) { } func TestStat(t *testing.T) { + t.Parallel() + fast := testMemory() slow := testMemory() cache := New(fast, slow, nil)