fix flaky busy test (#20861)
* fix flaky busy test * increase busy duration
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
8ce11f0806
Коммит
ddce3fa47b
@@ -15,7 +15,6 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func TestBusySet(t *testing.T) {
|
func TestBusySet(t *testing.T) {
|
||||||
t.Skip("MM-45725")
|
|
||||||
cluster := &ClusterMock{Busy: &Busy{}}
|
cluster := &ClusterMock{Busy: &Busy{}}
|
||||||
busy := NewBusy(cluster)
|
busy := NewBusy(cluster)
|
||||||
|
|
||||||
@@ -25,11 +24,12 @@ func TestBusySet(t *testing.T) {
|
|||||||
|
|
||||||
require.False(t, busy.IsBusy())
|
require.False(t, busy.IsBusy())
|
||||||
|
|
||||||
busy.Set(time.Millisecond * 100)
|
busy.Set(time.Millisecond * 500)
|
||||||
require.True(t, busy.IsBusy())
|
require.True(t, busy.IsBusy())
|
||||||
require.True(t, compareBusyState(t, busy, cluster.Busy))
|
require.True(t, compareBusyState(t, busy, cluster.Busy))
|
||||||
// should automatically expire after 100ms.
|
|
||||||
require.Eventually(t, isNotBusy, time.Second*15, time.Millisecond*20)
|
// should automatically expire after 500ms.
|
||||||
|
require.Eventually(t, isNotBusy, time.Second*15, time.Millisecond*100)
|
||||||
// allow a moment for cluster to sync.
|
// allow a moment for cluster to sync.
|
||||||
require.Eventually(t, func() bool { return compareBusyState(t, busy, cluster.Busy) }, time.Second*15, time.Millisecond*20)
|
require.Eventually(t, func() bool { return compareBusyState(t, busy, cluster.Busy) }, time.Second*15, time.Millisecond*20)
|
||||||
|
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user