Jetlag Getting started Docs GitLab Hub

SlopKit Jetlag

Run your software weeks ahead without restarting it

Jetlag changes the date and time that running processes see, so you can check what a trial, an expiry or a scheduled job does on a deployed environment without waiting for the day.

jetlag shift
Move the clock of running processes ahead by an offset such as 30d, or to a given time. Add --freeze to stop it there.
jetlag run
Start a program already shifted. It needs no privilege, and it shifts the processes the program starts too.
jetlag reset
Return the processes to real time, as if Jetlag had never touched them.
30 days ahead
$ date -u
Fri Dec  4 08:07:01 PM UTC 2026
$ bin/jetlag run --offset 30d -- date -u
jetlag: started date as pid 2265842
Sun Jan  3 08:07:01 PM UTC 2027

Real output from Getting started.

Build from source

Jetlag has no published release yet. It builds from source in the dev shell of the repo. Linux x86-64.

devenv shell
go build -o bin/jetlag ./cmd/jetlag

Why Jetlag

A date-dependent behavior is hard to test because it happens on a date. Jetlag moves the date for the processes you pick and leaves the rest of the machine alone.

No restart
Jetlag shifts a process that is already running. Each process holds its own shift, so Jetlag keeps no database: any jetlag can read, advance or reset what another one shifted.
No change to the program
It covers static Go and Rust binaries and Postgres. Clock fakers that preload a library into a program miss static binaries. The program needs no test hook for the clock.
Scoped
A Clock Shift applies to the Target you name and to nothing else. jetlag resolve lists the processes a Target selects before you change anything.
Reversible
A reset removes the change from every process.
Scriptable
The command line and a small HTTP API do the same operations, so a test runner can shift and reset the clock.

Put the clock back while it runs

One loop prints the date every second, 30 days ahead. A reset from a second terminal brings it back to today. The loop is never restarted.

Terminal 1
$ bin/jetlag run --offset 30d --listen 127.0.0.1:7420 -- sh -c 'while true; do date -u; sleep 1; done'
jetlag: started sh as pid 2265942
jetlag: listening on http://127.0.0.1:7420
Sun Jan  3 08:07:06 PM UTC 2027
Sun Jan  3 08:07:07 PM UTC 2027
...
Sun Jan  3 08:07:09 PM UTC 2027
Fri Dec  4 08:07:10 PM UTC 2026
Fri Dec  4 08:07:11 PM UTC 2026
Terminal 2
$ bin/jetlag reset --server http://127.0.0.1:7420 --target child
tree:2265942: 2 processes
  PID      COMM   MODE  OFFSET  WALL CLOCK
  2265942  sh     real  0s      2026-12-04T20:07:10Z
  2265972  sleep  real  0s      2026-12-04T20:07:10Z

Real output from Getting started, shortened. The pids and dates on your machine will differ.

Where it fits

Hunt is the SlopKit test runner. It drives Jetlag through the HTTP API: a Scenario can shift the clock, and Hunt resets it when the Scenario ends. Jetlag also works alone, from a shell.

Hunt

A Scenario shifts the clock, and Hunt resets it when the Scenario ends.

Jetlag HTTP API

The same operations as the command line, so a test runner can shift and reset the clock.

Target

One process, a process tree, a cgroup, the pods of a Kubernetes label selector, or the program jetlag run started.

Before you use it

Read these before you rely on it.

Words used on this site

Clock Shift
A change to the time a set of processes sees: a jump forward by an Offset, a Freeze, or both. It lasts until it is reset.
Target
The processes a Clock Shift applies to: one process, a process and its descendants, a cgroup, the pods of a Kubernetes label selector, or the program jetlag run started. Processes that start inside a Target while the shift is active are shifted too.
Offset
How far a Target's clock is ahead of real time, written like 30d, -2h or 90m.
Freeze
Stopping a Target's clock at one instant until you advance it, unfreeze it or reset it.

Start a program 30 days ahead.

Getting started builds Jetlag, shifts a running loop and puts its clock back. Commands, Targets and the HTTP API are in Docs.