clocktest

package
v3.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 12, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package clocktest lets tests wait on the cached, second-granularity clock that fiber's memory storages and rate-limit windows are measured against.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SleepPast

func SleepPast(tb testing.TB, ttl time.Duration)

SleepPast waits out ttl in wall time and then blocks until utils.Timestamp() has advanced by ttl truncated to whole seconds, the granularity the storages compare expiry against.

Expiry is compared against that cached timestamp, and the goroutine refreshing it once per second can be scheduled well over a second late on a loaded machine, so a wall-clock sleep alone leaves entries live past their TTL often enough to turn CI red.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL