Documentation
¶
Overview ¶
Package testutil holds helpers shared by tests.
Index ¶
- Variables
- func Eventually(tb testing.TB, cond func() bool, timeout time.Duration, msgAndArgs ...any)
- type FakeStore
- func (s *FakeStore) AcquireLease(_ context.Context, _, id string, now time.Time, ttl time.Duration) (bool, error)
- func (s *FakeStore) CancelRequested(_ context.Context, ids []int64) ([]int64, error)
- func (s *FakeStore) Complete(_ context.Context, clientID string, cs []job.Completion) ([]int64, error)
- func (s *FakeStore) DeleteFinalized(_ context.Context, state job.State, cutoff time.Time, limit int) (int, error)
- func (s *FakeStore) EnqueueTick(_ context.Context, name string, tick time.Time, p job.InsertParams) (bool, error)
- func (s *FakeStore) FailNext(n int)
- func (s *FakeStore) Fetch(_ context.Context, p job.FetchParams) ([]*job.Row, error)
- func (s *FakeStore) Heartbeat(_ context.Context, clientID string, now time.Time, refs []job.Ref) (int, error)
- func (s *FakeStore) Insert(p job.InsertParams) int64
- func (s *FakeStore) Job(id int64) (job.Row, bool)
- func (s *FakeStore) Jobs() []job.Row
- func (s *FakeStore) KeyStats(_ context.Context, queue string, limit int, _ bool) ([]job.KeyStat, error)
- func (s *FakeStore) LastTicks(context.Context) (map[string]time.Time, error)
- func (s *FakeStore) LeaseHolder() (string, time.Time)
- func (s *FakeStore) MarkPeriodicStart(_ context.Context, name string, now time.Time) error
- func (s *FakeStore) PromoteDue(_ context.Context, now time.Time, limit int) (int, error)
- func (s *FakeStore) PruneTicks(_ context.Context, cutoff time.Time) (int, error)
- func (s *FakeStore) QueueDepths(context.Context) ([]job.QueueDepth, error)
- func (s *FakeStore) QueueHeartbeat(_ context.Context, queue string, _ time.Time) (bool, error)
- func (s *FakeStore) Reindex(context.Context) (bool, error)
- func (s *FakeStore) ReleaseLease(_ context.Context, _, id string) error
- func (s *FakeStore) RenewLease(_ context.Context, _, id string, now time.Time, ttl time.Duration) (bool, error)
- func (s *FakeStore) Rescue(_ context.Context, cutoff time.Time, cs []job.Completion) (int, error)
- func (s *FakeStore) RunningByKey(queue string) map[string]int
- func (s *FakeStore) SetPaused(queue string, paused bool)
- func (s *FakeStore) StuckJobs(_ context.Context, cutoff time.Time, limit int) ([]*job.Row, error)
- func (s *FakeStore) Ticks(name string) []time.Time
- func (s *FakeStore) Update(id int64, fn func(*job.Row))
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInjected = errors.New("fakestore: injected failure")
Functions ¶
Types ¶
type FakeStore ¶
FakeStore is an in-memory job store with the same semantics as the Postgres adapter.
func (*FakeStore) AcquireLease ¶
func (*FakeStore) CancelRequested ¶
func (*FakeStore) DeleteFinalized ¶
func (*FakeStore) EnqueueTick ¶
func (*FakeStore) MarkPeriodicStart ¶
func (*FakeStore) PromoteDue ¶
func (*FakeStore) PruneTicks ¶
func (*FakeStore) QueueDepths ¶
func (*FakeStore) QueueHeartbeat ¶
func (*FakeStore) ReleaseLease ¶
func (*FakeStore) RenewLease ¶
Click to show internal directories.
Click to hide internal directories.