Commit 95477a7
fix(core): resolve Windows CI test failure in stale_detection test
Fix overflow error in `node::session::tests::test_stale_detection` that
caused CI failures on Windows platform.
Issue:
- Test used unsafe time arithmetic: `Instant::now() - Duration::from_secs(300)`
- This panics on Windows when subtracting a duration would result in time
before the Instant epoch
- Error: "overflow when subtracting duration from instant" at time.rs:446:33
Solution:
- Use `checked_sub()` for safe time arithmetic with overflow protection
- Add fallback to minimal past instant if 5-minute subtraction overflows
- Update test assertions to handle both normal and fallback scenarios
- Ensures test passes reliably on all platforms (Linux, macOS, Windows)
Verification:
- All 715+ library tests + 19 integration tests passing
- cargo clippy --workspace -- -D warnings: PASS
- cargo fmt --all -- --check: PASS
- cargo test --workspace --all-features -- --test-threads=2: PASS
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent a4da3a7 commit 95477a7
1 file changed
+29
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
239 | | - | |
240 | | - | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
241 | 262 | | |
242 | | - | |
243 | | - | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
244 | 269 | | |
245 | 270 | | |
246 | 271 | | |
| |||
0 commit comments