Commit 0740ff9
Fix three broken/flaky Tsavorite and Garnet tests (#1711)
1. LargeObjectMultiFlushedPages (Tsavorite ObjectTests):
Remove [Explicit] and add a no-op ShiftReadOnlyAddress(currentROA,
wait: true) sync point so the FlushedUntilAddress / ReadOnlyAddress
assertions see a quiesced state after the async flush pipeline
catches up. MonotonicUpdate is a no-op when passed the current ROA;
the built-in wait loop in ShiftReadOnlyAddressWithWait blocks until
FUA >= ROA, which is exactly the observation the test wants.
2. LargeObjectLinearizeFlushedPages (Tsavorite ObjectTests):
Drop the Is.True assertion on the second ShiftReadOnlyAddress in
DoFlush. That call intentionally races with the main thread's
ShiftReadOnlyToTail; if the latter wins, MonotonicUpdate correctly
refuses to move ROA backwards and returns false. The post-
Task.WhenAll invariants (ROA == FUA == TailAddress) still fully
verify correctness, and the test continues to exercise the
overlapping-shift linearization path.
3. ConfigSetHeapMemorySizeUtilizationTest (Garnet RespConfigTests):
Rewrite test body. The old test inserted 4 tiny lists (i++ inside
the loop meant only 4 unique keys) against a 3MB budget, so the
LogSizeTracker never saw over-budget and PostMemoryTrim was never
invoked; trimCompleteEvent.Wait timed out at 90s. The post-wait
assertion also expected AllocatedPageCount < MinLogAllocatedPageCount
(== 2), which is logically impossible. The fix inserts 128 list
objects with meaningful heap (16 * 256-byte items each, ~512 KB
total), then issues CONFIG SET memory 8192 to trigger the shrink
branch of UpdateTargetSize. TotalSize > highTargetSize causes the
resizer to compute an eviction range, shift addresses with
waitForEviction, and invoke PostMemoryTrim. The test now waits at
most ~30s for the callback and asserts that APC or heap actually
decreased. Remove [Explicit].
No product code changes. Validated with many consecutive green runs
of each affected test, plus a full pass of the LargeObject and
RespConfig* suites.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 8113f56 commit 0740ff9
2 files changed
Lines changed: 60 additions & 41 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
273 | 273 | | |
274 | 274 | | |
275 | 275 | | |
276 | | - | |
277 | 276 | | |
278 | 277 | | |
279 | 278 | | |
| |||
304 | 303 | | |
305 | 304 | | |
306 | 305 | | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
307 | 313 | | |
308 | | - | |
309 | | - | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
310 | 317 | | |
311 | 318 | | |
312 | | - | |
| 319 | + | |
313 | 320 | | |
314 | 321 | | |
315 | 322 | | |
| |||
463 | 470 | | |
464 | 471 | | |
465 | 472 | | |
| 473 | + | |
466 | 474 | | |
467 | 475 | | |
468 | | - | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
469 | 483 | | |
470 | 484 | | |
471 | 485 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
682 | 682 | | |
683 | 683 | | |
684 | 684 | | |
685 | | - | |
686 | | - | |
| 685 | + | |
| 686 | + | |
687 | 687 | | |
688 | | - | |
| 688 | + | |
689 | 689 | | |
690 | 690 | | |
691 | | - | |
692 | | - | |
| 691 | + | |
693 | 692 | | |
694 | 693 | | |
695 | 694 | | |
696 | 695 | | |
697 | 696 | | |
698 | | - | |
699 | 697 | | |
700 | 698 | | |
701 | 699 | | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
702 | 703 | | |
703 | 704 | | |
704 | 705 | | |
705 | | - | |
706 | | - | |
707 | | - | |
708 | | - | |
709 | | - | |
710 | | - | |
711 | | - | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
712 | 711 | | |
| 712 | + | |
713 | 713 | | |
714 | | - | |
715 | | - | |
716 | | - | |
717 | | - | |
718 | | - | |
719 | | - | |
720 | | - | |
721 | | - | |
722 | | - | |
723 | | - | |
724 | | - | |
725 | | - | |
726 | | - | |
727 | | - | |
728 | | - | |
729 | | - | |
730 | | - | |
731 | | - | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
732 | 729 | | |
733 | | - | |
734 | | - | |
735 | | - | |
736 | | - | |
737 | | - | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
738 | 743 | | |
739 | 744 | | |
740 | 745 | | |
0 commit comments