Atlas › Test
Test_NotOK_DelayFrom
Exact test identity: go.temporal.io/server/common/quotas/TestMultiReservationSuite/Test_NotOK_DelayFrom
- Package
go.temporal.io/server/common/quotas
- Suite / test hierarchy
TestMultiReservationSuite/Test_NotOK_DelayFrom
- Test
Test_NotOK_DelayFrom
- Introduced at
- multi_reservation_impl.go ×1 Frontier kind: Joint frontier
- Covered ranges
- 5
- Covered lines
- 15
- Covered files
- 2
Covered source
Expand a file to inspect source; the > gutter marks covered lines.
go.temporal.io/server/common/quotas/multi_reservation_impl.go 10 covered LOC · 4 ranges
Open complete file
17
ok bool,
18
reservations []Reservation,
20
>
if ok && len(reservations) == 0 {
21
panic("expect at least one reservation")
22
}
24
>
ok: ok,
25
>
reservations: reservations,
26
>
}
27
}
28
59
// before taking the reserved action. Zero duration means act immediately.
60
// MultiReservation DelayFrom returns the maximum delay of all its sub-reservations.
62
>
if !r.ok {
64
>
}
65
66
result := r.reservations[0].DelayFrom(now)
go.temporal.io/server/common/quotas/reservation_mock.go 5 covered LOC · 1 range
Open complete file
30
31
// NewMockReservation creates a new mock instance.
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.