Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions pkg/lockservice/service_forward_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,6 @@ func TestForwardLockUsesEffectiveLockDeadline(t *testing.T) {

options := newTestRowExclusiveOptions()
options.ForwardTo = owner.serviceID
options.LockWaitTimeout = 1
// Forwarded txns are normally created by the frontend txn lifecycle on
// the origin CN. Register both here so owner-side orphan detection sees
// the same liveness state as production while the waiter is blocked.
Expand All @@ -281,10 +280,13 @@ func TestForwardLockUsesEffectiveLockDeadline(t *testing.T) {

// A deadline-less background context previously reached morpc.Send
// unchanged and panicked. Service entry must inject and propagate the
// effective lock deadline to the forwarded RPC.
// effective safety deadline to the forwarded RPC. Establish this
// uncontended holder separately from the one-second budget asserted by
// the waiter below: each Lock call owns an independent wait budget.
_, err = origin.Lock(context.Background(), tableID, [][]byte{{1}}, holderTxn, options)
require.NoError(t, err)

options.LockWaitTimeout = 1
start := time.Now()
_, err = origin.Lock(context.Background(), tableID, [][]byte{{1}}, waiterTxn, options)
require.True(t, moerr.IsMoErrCode(err, moerr.ErrLockWaitTimeout), "unexpected error: %v", err)
Expand Down
Loading