Home / Testing
Practice
How to test
Do not set a production clock to 2038. Build a disposable image, feed it the boundary values, and watch logs, files and certificates.
Values worth using
| Unix seconds | UTC | Why |
|---|---|---|
| 2147483646 | 2038-01-19 03:14:06 | Last-but-one good second |
| 2147483647 | 2038-01-19 03:14:07 | Last representable signed 32-bit second |
| 2147483648 | overflow | Does the API accept it, reject it, or wrap? |
| now + 10 years | varies | Backwards Risk for a 10-year warranty |
C smoke test
#include <stdio.h>
#include <time.h>
int main(void) {
time_t t = (time_t)2147483647;
printf("time_t bytes=%zu last=%s", sizeof(time_t), ctime(&t));
t = (time_t)2147483648U;
printf("plus1=%s", ctime(&t));
}
If sizeof(time_t) is 4, you are looking at a time32 ABI. If it is 8, the language binding is clear; your files and columns may not be.
Operational tests
- Create a file, set its mtime past 2038, unmount, remount,
statit. - Insert a row with a 2039 timestamp; read it back.
- Issue a certificate that expires in 2040; see whether the verifier accepts the dates.
- On NTP clients, check documented era handling before February 2036 — a different bug.