Atlas › Test

Test_DelayFrom

Exact test identity: go.temporal.io/server/common/quotas/TestPriorityReservationSuite/Test_DelayFrom

Package
go.temporal.io/server/common/quotas
Suite / test hierarchy
TestPriorityReservationSuite/Test_DelayFrom
Test
Test_DelayFrom
Introduced at
Test_DelayFrom Frontier kind: Test frontier
Covered ranges
6
Covered lines
27
Covered files
2

Covered source

Expand a file to inspect source; the > gutter marks covered lines.

go.temporal.io/server/common/quotas/reservation_mock.go 18 covered LOC · 4 ranges

Open complete file

30
31 // NewMockReservation creates a new mock instance.
32 > func NewMockReservation(ctrl *gomock.Controller) *MockReservation { reservation_mock.go
33 > mock := &MockReservation{ctrl: ctrl}
34 > mock.recorder = &MockReservationMockRecorder{mock}
35 > return mock
36 > }
37
38 // EXPECT returns an object that allows the caller to indicate expected use.
39 > func (m *MockReservation) EXPECT() *MockReservationMockRecorder { reservation_mock.go
40 > return m.recorder
41 > }
42
43 // Cancel mocks base method.
80
81 // DelayFrom mocks base method.
82 > func (m *MockReservation) DelayFrom(now time.Time) time.Duration { reservation_mock.go
83 > m.ctrl.T.Helper()
84 > ret := m.ctrl.Call(m, "DelayFrom", now)
85 > ret0, _ := ret[0].(time.Duration)
86 > return ret0
87 > }
88
89 // DelayFrom indicates an expected call of DelayFrom.
90 > func (mr *MockReservationMockRecorder) DelayFrom(now any) *gomock.Call { reservation_mock.go
91 > mr.mock.ctrl.T.Helper()
92 > return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DelayFrom", reflect.TypeOf((*MockReservation)(nil).DelayFrom), now)
93 > }
94
95 // OK mocks base method.
go.temporal.io/server/common/quotas/priority_reservation_impl.go 9 covered LOC · 2 ranges

Open complete file

17 decidingReservation Reservation,
18 otherReservations []Reservation,
19 > ) *PriorityReservationImpl { priority_reservation_impl.go
20 > return &PriorityReservationImpl{
21 > decidingReservation: decidingReservation,
22 > otherReservations: otherReservations,
23 > }
24 > }
25
26 // OK returns whether the limiter can provide the requested number of tokens
52 // DelayFrom returns the duration for which the reservation holder must wait
53 // before taking the reserved action. Zero duration means act immediately.
54 > func (r *PriorityReservationImpl) DelayFrom(now time.Time) time.Duration { priority_reservation_impl.go
55 > return r.decidingReservation.DelayFrom(now)
56 > }