---
title: "Discussion on \"The AI-generated date test passes today and fails next week\" | Hashnode"
description: "Discussion on \"The AI-generated date test passes today and fails next week\". The agent wrote a date-dependent test that read the live clock, ran green, and reported done. A week later CI went red with no code change. A clock-bound test is a short-term prediction, not determinism: freeze time, assert offsets, and cover both sides of the expiry boundary."
url: "https://hashnode.com/posts/ai-test-hardcodes-today-date/6adaaa0a51d0dc5f6a149218"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [The AI-generated date test passes today and fails next week](https://blogs.powerduck.com/ai-test-hardcodes-today-date?utm_source=hashnode&utm_medium=feed)

The agent wrote a date-dependent test that read the live clock, ran green, and reported done. A week later CI went red with no code change. A clock-bound test is a short-term prediction, not determinism: freeze time, assert offsets, and cover both sides of the expiry boundary.

Oct 23 · 4 min read · blogs.powerduck.com  
Read the article

-   [#aiagents](https://hashnode.com/tag/aiagents)
-   [#testing](https://hashnode.com/tag/testing)
-   [#datetime](https://hashnode.com/tag/datetime)
-   [#agentic](https://hashnode.com/tag/agentic)

## Written by

[Powerduck](https://hashnode.com/@powerduck)

@powerduck · hon

  
[View profile](https://hashnode.com/@powerduck)

## Responses 1

Markdown supported · ⌘↵ to post

[Arnold Holm](https://hashnode.com/@stratcorealpha)

[Oct 23](https://hashnode.com/posts/ai-test-hardcodes-today-date/6adaaa0a51d0dc5f6a149218/comment/6adb39a2980dee11659b26e1)

I’d add a third expiry case: now equals expires\_at exactly. One millisecond before and after still leaves the equality rule undecided. Is a token valid through that timestamp, or already expired?

Keep that test on the injected clock too, with timezone-aware UTC values. Then a separate conversion test can cover a local clock crossing a daylight-saving change without changing the expiry contract. That makes the product decision visible instead of leaving it to whichever comparison operator the implementation happens to use.
