clock-skew

command
v1.22.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: MIT Imports: 6 Imported by: 0

README

clock-skew

Demonstrates fault.Clock: a skewed wall clock observed through engine.Now.

A token-expiry check reads the clock with engine.Now(ctx) instead of time.Now(). A chaos rule attaches a fault.Clock(2h) fault to the token.validate explicit point. Before the point fires the token is valid; after it fires the clock jumps two hours ahead — past the token's one-hour TTL — and the same token reads as expired. This is the bug class fault.Clock exists to surface: deadline / expiry / timezone arithmetic that only breaks when the clock is wrong.

go run . go test ./…

Documentation

Overview

Command clock-skew demonstrates fault.Clock. A token-expiry check that reads the clock through engine.Now (instead of time.Now) is shown to expire a still-valid token once a chaos rule skews the clock past the token's TTL. Run with `go run .`.

Jump to

Keyboard shortcuts

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