1
0
Fork 0
mirror of https://github.com/anyproto/anytype-heart.git synced 2025-06-07 21:37:04 +09:00

GO-4146 Increase test timeouts

This commit is contained in:
Mikhail Rakhmanov 2025-03-03 19:32:15 +01:00
parent 4466d9167d
commit 3e98ab0e96
No known key found for this signature in database
GPG key ID: DED12CFEF5B8396B

View file

@ -7,8 +7,8 @@ import (
"time"
"github.com/cheggaaa/mb/v3"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"
"github.com/valyala/fastjson"
"github.com/anyproto/anytype-heart/metrics/anymetry"
@ -79,19 +79,19 @@ func TestClient_SendEvents(t *testing.T) {
go c.startSendingBatchMessages(&testAppInfoProvider{})
c.send(&testEvent{})
time.Sleep(1 * time.Millisecond)
time.Sleep(100 * time.Millisecond)
assert.Equal(t, 1, c.batcher.Len())
require.Equal(t, 1, c.batcher.Len())
telemetry.AssertNotCalled(t, "SendEvents", mock.Anything, mock.Anything)
c.send(&testEvent{})
time.Sleep(1 * time.Millisecond)
time.Sleep(100 * time.Millisecond)
mutex.Lock()
assert.Equal(t, 0, c.batcher.Len())
assert.Equal(t, 2, len(events))
require.Equal(t, 0, c.batcher.Len())
require.Equal(t, 2, len(events))
mutex.Unlock()
assert.True(t, events[0].GetTimestamp() > 0)
require.True(t, events[0].GetTimestamp() > 0)
telemetry.AssertCalled(t, "SendEvents", mock.Anything, mock.Anything)
}