Files
seaweedfs/weed
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-08-09 21:47:29 -07:00
2025-07-19 23:56:17 -07:00
fix
2025-09-04 00:07:06 -07:00
2025-08-30 11:15:48 -07:00
2025-08-31 23:31:28 -07:00
2025-08-30 11:15:48 -07:00
fix
2025-09-04 00:07:06 -07:00
2025-08-22 01:15:42 -07:00
2025-08-30 11:15:48 -07:00
2024-06-25 09:18:11 -07:00
fix
2025-09-03 22:57:47 -07:00
2025-08-30 11:15:48 -07:00
2025-09-03 17:42:30 -07:00
2024-02-14 08:26:38 -08:00
2025-09-03 21:55:32 -07:00
2025-07-19 21:43:34 -07:00
2025-03-17 23:13:27 -07:00