MM-17311 - Flaky TestGroupStore/UpsertMember (#11717)
* MM-17311 - Flaky TestGroupStore/UpsertMember * PR Feedback
Этот коммит содержится в:
@@ -9,6 +9,7 @@ import (
|
|||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
@@ -581,6 +582,8 @@ func testUpsertMember(t *testing.T, ss store.Store) {
|
|||||||
require.Zero(t, d2.DeleteAt)
|
require.Zero(t, d2.DeleteAt)
|
||||||
|
|
||||||
// Duplicate composite key (GroupId, UserId)
|
// Duplicate composite key (GroupId, UserId)
|
||||||
|
// Ensure new CreateAt > previous CreateAt for the same (groupId, userId)
|
||||||
|
time.Sleep(1 * time.Millisecond)
|
||||||
_, err = ss.Group().UpsertMember(group.Id, user.Id)
|
_, err = ss.Group().UpsertMember(group.Id, user.Id)
|
||||||
require.Nil(t, err)
|
require.Nil(t, err)
|
||||||
|
|
||||||
@@ -589,6 +592,8 @@ func testUpsertMember(t *testing.T, ss store.Store) {
|
|||||||
require.Equal(t, err.Id, "store.insert_error")
|
require.Equal(t, err.Id, "store.insert_error")
|
||||||
|
|
||||||
// Restores a deleted member
|
// Restores a deleted member
|
||||||
|
// Ensure new CreateAt > previous CreateAt for the same (groupId, userId)
|
||||||
|
time.Sleep(1 * time.Millisecond)
|
||||||
_, err = ss.Group().UpsertMember(group.Id, user.Id)
|
_, err = ss.Group().UpsertMember(group.Id, user.Id)
|
||||||
require.Nil(t, err)
|
require.Nil(t, err)
|
||||||
|
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user