Skip to content

test: fix date/time dependent test failure (again)#1028

Merged
JohnVillalovos merged 1 commit intodevelopfrom
jlvillal/time_fix
Feb 16, 2026
Merged

test: fix date/time dependent test failure (again)#1028
JohnVillalovos merged 1 commit intodevelopfrom
jlvillal/time_fix

Conversation

@JohnVillalovos
Copy link
Collaborator

Use Date::_SetNow() to set a fixed date/time for the test

Use Date::_SetNow() to set a fixed date/time for the test
Copilot AI review requested due to automatic review settings February 16, 2026 15:27
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes date/time dependent test failures in two reservation test methods by replacing the use of TestBase::GetTestDate() with explicit Date::_SetNow() calls. The issue with TestBase::GetTestDate() is that it internally calls Date::Now(), making the tests non-deterministic and prone to failure at different times or in different timezones.

Changes:

  • Replace TestBase::GetTestDate() with fixed date mocking using Date::_SetNow() in two test methods
  • Set a fixed "now" (January 15, 2026, 12:00 PM America/Chicago) before calculating test dates
  • Makes tests fully deterministic and timezone-independent

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@JohnVillalovos JohnVillalovos merged commit 9d46a88 into develop Feb 16, 2026
18 checks passed
@JohnVillalovos JohnVillalovos deleted the jlvillal/time_fix branch February 16, 2026 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments