[#321] shard/test: Execute tests in parallel

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
pull/342/head
Evgenii Stratonikov 2023-05-05 14:08:10 +03:00 committed by Evgenii Stratonikov
parent d35e4c389f
commit 4578d00619
12 changed files with 37 additions and 0 deletions

View File

@ -43,6 +43,8 @@ type objAddr struct {
}
func TestShardOpen(t *testing.T) {
t.Parallel()
dir := t.TempDir()
metaPath := filepath.Join(dir, "meta")
@ -111,6 +113,8 @@ func TestShardOpen(t *testing.T) {
}
func TestRefillMetabaseCorrupted(t *testing.T) {
t.Parallel()
dir := t.TempDir()
fsTree := fstree.New(
@ -164,6 +168,8 @@ func TestRefillMetabaseCorrupted(t *testing.T) {
}
func TestRefillMetabase(t *testing.T) {
t.Parallel()
p := t.Name()
defer os.RemoveAll(p)

View File

@ -13,11 +13,15 @@ import (
)
func TestShard_Delete(t *testing.T) {
t.Parallel()
t.Run("without write cache", func(t *testing.T) {
t.Parallel()
testShardDelete(t, false)
})
t.Run("with write cache", func(t *testing.T) {
t.Parallel()
testShardDelete(t, true)
})
}

View File

@ -25,6 +25,8 @@ import (
)
func Test_GCDropsLockedExpiredObject(t *testing.T) {
t.Parallel()
var sh *shard.Shard
epoch := &epochState{

View File

@ -17,11 +17,15 @@ import (
)
func TestShard_Get(t *testing.T) {
t.Parallel()
t.Run("without write cache", func(t *testing.T) {
t.Parallel()
testShardGet(t, false)
})
t.Run("with write cache", func(t *testing.T) {
t.Parallel()
testShardGet(t, true)
})
}

View File

@ -15,11 +15,15 @@ import (
)
func TestShard_Head(t *testing.T) {
t.Parallel()
t.Run("without write cache", func(t *testing.T) {
t.Parallel()
testShardHead(t, false)
})
t.Run("with write cache", func(t *testing.T) {
t.Parallel()
testShardHead(t, true)
})
}

View File

@ -13,11 +13,15 @@ import (
)
func TestShard_Inhume(t *testing.T) {
t.Parallel()
t.Run("without write cache", func(t *testing.T) {
t.Parallel()
testShardInhume(t, false)
})
t.Run("with write cache", func(t *testing.T) {
t.Parallel()
testShardInhume(t, true)
})
}

View File

@ -14,6 +14,8 @@ import (
)
func TestShard_List(t *testing.T) {
t.Parallel()
t.Run("without write cache", func(t *testing.T) {
t.Parallel()
sh := newShard(t, false)

View File

@ -23,6 +23,8 @@ import (
)
func TestShard_Lock(t *testing.T) {
t.Parallel()
var sh *shard.Shard
rootPath := t.TempDir()

View File

@ -72,6 +72,8 @@ const physical = "phy"
const logical = "logic"
func TestCounters(t *testing.T) {
t.Parallel()
dir := t.TempDir()
sh, mm := shardWithMetrics(t, dir)

View File

@ -22,11 +22,14 @@ import (
)
func TestShard_GetRange(t *testing.T) {
t.Parallel()
t.Run("without write cache", func(t *testing.T) {
t.Parallel()
testShardGetRange(t, false)
})
t.Run("with write cache", func(t *testing.T) {
t.Parallel()
testShardGetRange(t, true)
})
}

View File

@ -24,6 +24,8 @@ import (
)
func TestShardReload(t *testing.T) {
t.Parallel()
p := t.Name()
defer os.RemoveAll(p)

View File

@ -16,6 +16,8 @@ import (
)
func TestWriteCacheObjectLoss(t *testing.T) {
t.Parallel()
const (
smallSize = 1024
objCount = 100