Skip to content

Fix TimeUtilTest failing on Wednesdays - #86

Merged
slominskir merged 1 commit into
mainfrom
encode-range-test-wednesday
Oct 7, 2026
Merged

slominskir merged 1 commit into
mainfrom
encode-range-test-wednesday

Conversation

@slominskir-coding-agent

@slominskir-coding-agent slominskir-coding-agent Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

./gradlew build fails on main today, a Wednesday:

TimeUtilTest > encodeRangeMatchesRangesRelativeToToday() FAILED
    org.opentest4j.AssertionFailedError: expected: <past7days> but was: <1week>

Weeks start on Wednesday, so on a Wednesday the seven days ending today are also last week. encodeRange checks for last week first, so it returns 1week. The test passed in CI yesterday (a Tuesday) and fails every Wednesday.

Changes

  • The past-seven-days assertion moves to a new test, encodeRangeOfThePastSevenDaysIsLastWeekOnWednesdays. It records the quirk: 1week on Wednesdays and past7days on other days.
  • encodeRangeMatchesRangesRelativeToToday now checks past3days and past10days. Neither can match a week.

Only the test changes. encodeRange behaves as before, so the public API is unaffected.

Checks

  • ./gradlew build failed on main with the error above and passes on this branch. All 65 TimeUtilTest tests pass, today being a Wednesday.
  • The new test's past7days (non-Wednesday) case has not run yet. The test reads the real clock, and installing faketime to fake it failed in the agent VM. It runs on any other day.
  • Integration tests not run: no demo code changed.

🤖 Generated with Claude Code

encodeRangeMatchesRangesRelativeToToday expected the seven days ending
today to encode as past7days. Weeks start on Wednesday, so on a
Wednesday those seven days are also last week, which encodeRange checks
first and returns as 1week. The test failed every Wednesday.

That assertion moves to its own test, which records the quirk: 1week
on Wednesdays, past7days on other days. The relative-to-today test
checks past3days and past10days instead, which never collide with a
week.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@slominskir
slominskir merged commit 771ff9f into main Oct 7, 2026
7 checks passed
@slominskir
slominskir deleted the encode-range-test-wednesday branch October 7, 2026 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

source::ai Work done by an AI agent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant