merged from gramsrv upstream
This commit is contained in:
parent
79c64ee916
commit
21a0856587
651 changed files with 54774 additions and 4590 deletions
|
|
@ -304,12 +304,18 @@ func TestMessageStorePrivateRandomIDConflictFallbackUsesTransactionConnection(t
|
|||
boxIDs := &perUserCounterAllocator{}
|
||||
db := &beginHookDB{Pool: pool}
|
||||
db.before = func(ctx context.Context) error {
|
||||
_, err := NewMessageStore(pool, WithMessageAllocators(boxIDs)).SendPrivateText(ctx, req)
|
||||
remote := NewMessageStore(pool, WithMessageAllocators(boxIDs))
|
||||
// A separate actor represents another server process. Cross-process
|
||||
// uniqueness must still resolve through the transaction connection.
|
||||
remote.privateSendLanes = newUserLaneActor()
|
||||
_, err := remote.SendPrivateText(ctx, req)
|
||||
return err
|
||||
}
|
||||
deadlineCtx, cancel := context.WithTimeout(context.Background(), 3*time.Second)
|
||||
defer cancel()
|
||||
got, err := NewMessageStore(db, WithMessageAllocators(boxIDs)).SendPrivateText(deadlineCtx, req)
|
||||
local := NewMessageStore(db, WithMessageAllocators(boxIDs))
|
||||
local.privateSendLanes = newUserLaneActor()
|
||||
got, err := local.SendPrivateText(deadlineCtx, req)
|
||||
if err != nil {
|
||||
t.Fatalf("conflict fallback with MaxConns=1: %v", err)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue