forked from TrueCloudLab/frostfs-node
[#321] engine/test: Execute tests in parallel
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
4578d00619
commit
945454f60c
5 changed files with 25 additions and 1 deletions
|
@ -77,6 +77,8 @@ func newEngineEvacuate(t *testing.T, shardNum int, objPerShard int) (*StorageEng
|
|||
}
|
||||
|
||||
func TestEvacuateShard(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
const objPerShard = 3
|
||||
|
||||
e, ids, objects := newEngineEvacuate(t, 3, objPerShard)
|
||||
|
@ -132,6 +134,8 @@ func TestEvacuateShard(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestEvacuateNetwork(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
var errReplication = errors.New("handler error")
|
||||
|
||||
acceptOneOf := func(objects []*objectSDK.Object, max int) func(context.Context, oid.Address, *objectSDK.Object) error {
|
||||
|
@ -154,6 +158,7 @@ func TestEvacuateNetwork(t *testing.T) {
|
|||
}
|
||||
|
||||
t.Run("single shard", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
e, ids, objects := newEngineEvacuate(t, 1, 3)
|
||||
evacuateShardID := ids[0].String()
|
||||
|
||||
|
@ -173,6 +178,7 @@ func TestEvacuateNetwork(t *testing.T) {
|
|||
require.Equal(t, 2, res.Count())
|
||||
})
|
||||
t.Run("multiple shards, evacuate one", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
e, ids, objects := newEngineEvacuate(t, 2, 3)
|
||||
|
||||
require.NoError(t, e.shards[ids[0].String()].SetMode(mode.ReadOnly))
|
||||
|
@ -195,6 +201,7 @@ func TestEvacuateNetwork(t *testing.T) {
|
|||
})
|
||||
})
|
||||
t.Run("multiple shards, evacuate many", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
e, ids, objects := newEngineEvacuate(t, 4, 5)
|
||||
evacuateIDs := ids[0:3]
|
||||
|
||||
|
@ -229,6 +236,7 @@ func TestEvacuateNetwork(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestEvacuateCancellation(t *testing.T) {
|
||||
t.Parallel()
|
||||
e, ids, _ := newEngineEvacuate(t, 2, 3)
|
||||
|
||||
require.NoError(t, e.shards[ids[0].String()].SetMode(mode.ReadOnly))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue