enable parallel execution for cache tests
This commit is contained in:
16
vfs/cache/cache_test.go
vendored
16
vfs/cache/cache_test.go
vendored
@@ -15,6 +15,8 @@ func testMemory() vfs.VFS {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestNew(t *testing.T) {
|
func TestNew(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
fast := testMemory()
|
fast := testMemory()
|
||||||
slow := testMemory()
|
slow := testMemory()
|
||||||
|
|
||||||
@@ -25,6 +27,8 @@ func TestNew(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestNewPanics(t *testing.T) {
|
func TestNewPanics(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
defer func() {
|
defer func() {
|
||||||
if r := recover(); r == nil {
|
if r := recover(); r == nil {
|
||||||
t.Fatal("expected panic but did not get one")
|
t.Fatal("expected panic but did not get one")
|
||||||
@@ -35,6 +39,8 @@ func TestNewPanics(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestSetAndGet(t *testing.T) {
|
func TestSetAndGet(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
fast := testMemory()
|
fast := testMemory()
|
||||||
slow := testMemory()
|
slow := testMemory()
|
||||||
cache := New(fast, slow, nil)
|
cache := New(fast, slow, nil)
|
||||||
@@ -57,6 +63,8 @@ func TestSetAndGet(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestSetAndGetNoFast(t *testing.T) {
|
func TestSetAndGetNoFast(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
slow := testMemory()
|
slow := testMemory()
|
||||||
cache := New(nil, slow, nil)
|
cache := New(nil, slow, nil)
|
||||||
|
|
||||||
@@ -77,6 +85,8 @@ func TestSetAndGetNoFast(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
func TestCaching(t *testing.T) {
|
func TestCaching(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
fast := testMemory()
|
fast := testMemory()
|
||||||
slow := testMemory()
|
slow := testMemory()
|
||||||
cache := New(fast, slow, func(fi *vfs.FileInfo, cs cachestate.CacheState) bool {
|
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) {
|
func TestGetNotFound(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
fast := testMemory()
|
fast := testMemory()
|
||||||
slow := testMemory()
|
slow := testMemory()
|
||||||
cache := New(fast, slow, nil)
|
cache := New(fast, slow, nil)
|
||||||
@@ -145,6 +157,8 @@ func TestGetNotFound(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestDelete(t *testing.T) {
|
func TestDelete(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
fast := testMemory()
|
fast := testMemory()
|
||||||
slow := testMemory()
|
slow := testMemory()
|
||||||
cache := New(fast, slow, nil)
|
cache := New(fast, slow, nil)
|
||||||
@@ -167,6 +181,8 @@ func TestDelete(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestStat(t *testing.T) {
|
func TestStat(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
fast := testMemory()
|
fast := testMemory()
|
||||||
slow := testMemory()
|
slow := testMemory()
|
||||||
cache := New(fast, slow, nil)
|
cache := New(fast, slow, nil)
|
||||||
|
|||||||
Reference in New Issue
Block a user