mirror of
https://github.com/mattermost/mattermost.git
synced 2026-09-24 16:05:00 +08:00
fix flaky busy test (#20861)
* fix flaky busy test * increase busy duration
This commit is contained in:
+4
-4
@@ -15,7 +15,6 @@ import (
|
||||
)
|
||||
|
||||
func TestBusySet(t *testing.T) {
|
||||
t.Skip("MM-45725")
|
||||
cluster := &ClusterMock{Busy: &Busy{}}
|
||||
busy := NewBusy(cluster)
|
||||
|
||||
@@ -25,11 +24,12 @@ func TestBusySet(t *testing.T) {
|
||||
|
||||
require.False(t, busy.IsBusy())
|
||||
|
||||
busy.Set(time.Millisecond * 100)
|
||||
busy.Set(time.Millisecond * 500)
|
||||
require.True(t, busy.IsBusy())
|
||||
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.
|
||||
require.Eventually(t, func() bool { return compareBusyState(t, busy, cluster.Busy) }, time.Second*15, time.Millisecond*20)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user