1
0
Fork 0
mirror of https://github.com/anyproto/any-sync.git synced 2025-06-08 14:07:02 +09:00

Fix tests

This commit is contained in:
Mikhail Rakhmanov 2025-04-22 16:13:18 +02:00
parent 68af5f1320
commit d2498a1c56
No known key found for this signature in database
GPG key ID: DED12CFEF5B8396B

View file

@ -2,12 +2,14 @@ package commonspace
import ( import (
"context" "context"
"errors"
"fmt" "fmt"
"math/rand" "math/rand"
"sync" "sync"
"testing" "testing"
"time" "time"
anystore "github.com/anyproto/any-store"
"github.com/anyproto/go-chash" "github.com/anyproto/go-chash"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"go.uber.org/zap" "go.uber.org/zap"
@ -803,6 +805,9 @@ func newMultiPeerFixture(t *testing.T, peerNum int) *multiPeerFixture {
err := listStorage.AddAll(ctx, []list.StorageRecord{ err := listStorage.AddAll(ctx, []list.StorageRecord{
{RawRecord: rec.Payload, Id: rec.Id, PrevId: prevRec, Order: i + 1, ChangeSize: len(rec.Payload)}, {RawRecord: rec.Payload, Id: rec.Id, PrevId: prevRec, Order: i + 1, ChangeSize: len(rec.Payload)},
}) })
if errors.Is(err, anystore.ErrDocExists) {
continue
}
require.NoError(t, err) require.NoError(t, err)
} }
} }