Commit 4442940
committed
Tests: Make index_mtime_change_invalidates_cache deterministic
`index_mtime_change_invalidates_cache` used to call `git add` and then `sleep(1100 ms)` so the FS-resolution lottery didn't squash the mtime change on overlayfs (CI's second-resolution timestamps). Worked, but spent ~1.3 s of pure wall-clock per run and the test was the slowest in the git module.
- Replaced the sleep with an explicit `filetime::set_file_mtime` bump on `.git/index` by +2 s after the `git add`. `list_status`'s cache check keys off that exact mtime, so the test exercises the same code path with no FS-quirks dependency.
- Now runs in 0.117 s (was ~1.3 s).1 parent 9e23ff2 commit 4442940
1 file changed
Lines changed: 13 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
464 | 464 | | |
465 | 465 | | |
466 | 466 | | |
467 | | - | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
468 | 475 | | |
469 | 476 | | |
470 | 477 | | |
471 | | - | |
472 | | - | |
473 | | - | |
474 | | - | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
475 | 483 | | |
476 | 484 | | |
477 | 485 | | |
| |||
0 commit comments