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--freezeto 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.
$ date -u Fri Dec 4 10:49:42 PM UTC 2026 $ jetlag run --offset 30d -- date -u jetlag: started date as pid 2638374 Sun Jan 3 10:49:42 PM UTC 2027
Real output from Getting started.
Install
Jetlag 0.1.0 is a self-extracting binary for Linux x86-64. No Nix, no root, no dev shell. The repo is public.
mkdir -p ~/.local/bin curl -fsSL -o ~/.local/jetlag "https://gitlab.techtailors.net/api/v4/projects/slopkit%2Fjetlag/packages/generic/jetlag/0.1.0/jetlag-linux-amd64" chmod +x ~/.local/bin/jetlag jetlag version
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
jetlagcan 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 resolvelists 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.
$ 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 2638391 jetlag: listening on http://127.0.0.1:7420 Sun Jan 3 10:49:42 PM UTC 2027 Sun Jan 3 10:49:43 PM UTC 2027 ... Sun Jan 3 10:49:45 PM UTC 2027 Fri Dec 4 10:49:46 PM UTC 2026 Fri Dec 4 10:49:47 PM UTC 2026
$ jetlag reset --server http://127.0.0.1:7420 --target child tree:2638391: 2 processes PID COMM MODE OFFSET WALL CLOCK 2638391 sh real 0s 2026-12-04T22:49:46Z 2638413 sleep real 0s 2026-12-04T22:49:46Z
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.
-
For Controlled Environments
Jetlag can change the time of any process it can reach, and on Kubernetes its node agent is close to root on its node.
-
Other processes need a privilege
Shifting a process Jetlag did not start needs the
CAP_SYS_PTRACEcapability on the binary, or root. A program started withjetlag runneeds nothing. -
Linux x86-64 only
That is the limit of epochd, which Jetlag builds on.
-
Kubernetes is untested on a real cluster
The Kubernetes Targets and the node agent have not been run on a real cluster.
-
epochd has one maintainer
Jetlag builds on epochd. Our changes to it live in a fork, slopkit/epochd (v0.8.1 plus three changes), and have not been sent upstream.
-
Kernel deadlines stay on real time
Timers that wait for an absolute deadline in the kernel still run on real time.
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 runstarted. 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,-2hor90m. - 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.