Commit 03339f2
Test that a non-positive signature cache bound is clamped
_EntityMethodSignatureCache clamps its bound with max(1, max_size), but
nothing covered that clamp, so the PR description overstated the test
coverage. Add regression tests for it.
The clamp is not cosmetic. Without it a bound of 0 evicts each entry
immediately after inserting it, so every lookup misses and the entity
method reflection this cache exists to avoid runs on every operation
again -- silently reintroducing the very problem this change fixes. A
negative bound is worse: the eviction loop keeps popping past an
already-empty dict and raises StopIteration.
The new tests cover a zero and negative bound, that a clamped cache
still behaves as a working size-one cache rather than a no-op, and that
an executor handed a clamped cache still reflects only once. Verified
red before green: with the clamp removed all five fail, including
'assert 3 == 1' on the reflection count.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 2265f7b9-f8ad-4b50-a25d-19bd6f1ac96c1 parent 1709591 commit 03339f2
1 file changed
Lines changed: 55 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
523 | 524 | | |
524 | 525 | | |
525 | 526 | | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
0 commit comments