Repository navigation
Fix TimeUtilTest failing on Wednesdays - #86
Merged
Merged
Conversation
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
approved these changes
Oct 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
./gradlew buildfails onmaintoday, a Wednesday:Weeks start on Wednesday, so on a Wednesday the seven days ending today are also last week.
encodeRangechecks for last week first, so it returns1week. The test passed in CI yesterday (a Tuesday) and fails every Wednesday.Changes
encodeRangeOfThePastSevenDaysIsLastWeekOnWednesdays. It records the quirk:1weekon Wednesdays andpast7dayson other days.encodeRangeMatchesRangesRelativeToTodaynow checkspast3daysandpast10days. Neither can match a week.Only the test changes.
encodeRangebehaves as before, so the public API is unaffected.Checks
./gradlew buildfailed onmainwith the error above and passes on this branch. All 65TimeUtilTesttests pass, today being a Wednesday.past7days(non-Wednesday) case has not run yet. The test reads the real clock, and installingfaketimeto fake it failed in the agent VM. It runs on any other day.🤖 Generated with Claude Code