Files
seaweedfs/weed/query/engine
chrislu 6fcc573709 fix: Improve test stability for date/time functions
**Problem:**
- CURRENT_TIMESTAMP test had timing race condition that could cause flaky failures
- CURRENT_DATE test could fail if run exactly at midnight boundary
- Tests were too strict about timing precision without accounting for system variations

**Root Cause:**
- Test captured before/after timestamps and expected function result to be exactly between them
- No tolerance for clock precision differences, NTP adjustments, or system timing variations
- Date boundary race condition around midnight transitions

**Solution:**
 **CURRENT_TIMESTAMP test**: Added 100ms tolerance buffer to account for:
  - Clock precision differences between time.Now() calls
  - System timing variations and NTP corrections
  - Microsecond vs nanosecond precision differences

 **CURRENT_DATE test**: Enhanced to handle midnight boundary crossings:
  - Captures date before and after function call
  - Accepts either date value in case of midnight transition
  - Prevents false failures during overnight test runs

**Testing:**
- Verified with repeated test runs (5x iterations) - all pass consistently
- Full test suite passes - no regressions introduced
- Tests are now robust against timing edge cases

**Impact:**
🚀 **Eliminated flaky test failures** while maintaining function correctness validation
🔧 **Production-ready testing** that works across different system environments
 **CI/CD reliability** - tests won't fail due to timing variations
2025-09-04 07:47:17 -07:00
..
2025-09-03 00:10:47 -07:00
2025-09-02 22:12:47 -07:00
2025-09-03 17:42:30 -07:00
2025-09-01 20:19:59 -07:00
2025-09-03 15:34:39 -07:00
2025-09-03 00:10:47 -07:00
2025-09-03 17:42:30 -07:00
2025-09-03 17:42:30 -07:00
fix
2025-09-04 00:07:06 -07:00
2025-09-01 18:52:22 -07:00
2025-09-01 19:36:47 -07:00
2025-09-02 22:12:47 -07:00
2025-09-02 22:12:47 -07:00
fix
2025-09-03 09:54:31 -07:00
2025-09-03 00:40:03 -07:00
2025-09-01 18:52:22 -07:00
2025-09-01 18:52:22 -07:00
2025-09-03 15:34:39 -07:00
2025-09-03 00:10:47 -07:00
2025-09-01 21:40:24 -07:00
2025-09-02 22:12:47 -07:00
fix
2025-09-03 21:44:27 -07:00
2025-09-02 22:12:47 -07:00