Commit 4d35a18
* test(pickle): add Linux-only test for inotify instance exhaustion (Issue #24)\n\nAdds a test to reproduce the 'inotify instance limit reached' error on Linux by rapidly creating many concurrent cache waits using the pickle backend. The test is skipped on non-Linux systems and is designed to be informative, not flaky.\n\nAlso updates CI to lower the inotify instance limit on Linux/local jobs, increasing the likelihood of hitting the error in CI.\n\nReferences: https://github.com/python-cachier/cachier/issues/24\n\n- Follows project and Python best practices for test isolation, OS-specific logic, and CI configuration.\n- Test is marked with @pytest.mark.pickle and uses pytest.skip for clarity.\n- CI change is Linux/local only, with clear comments.\n\nThis helps document and track the resource exhaustion issue, and provides a reproducible test for future backend or watchdog improvements.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* style(tests): fix long lines for Ruff E501 compliance in test_pickle_core.py
* style(tests): split long lines in test_pickle_core.py to satisfy Ruff E501
* Make inotify test more aggressive and force failure instead of skip
- Increase thread count to 4x the system limit (up to 4096)
- Make the slow function slower (0.5s instead of 0.1s)
- Increase wait_for_calc_timeout to 0.1s
- Force test to fail instead of skip when limit not hit
- Add more debugging output to understand what's happening
This should help reproduce the inotify instance limit issue in CI.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Reverse inotify test logic: now fails when bug exists, passes when fixed
- Test now FAILS when inotify instance limit is reached (bug exists)
- Test now PASSES when no inotify errors occur (bug is fixed)
- This makes the test useful for verifying fixes to the inotify issue
- Updated error messages to reflect the new logic
* Add xfail marker to inotify test
- Test is now marked as expected to fail with @pytest.mark.xfail
- Will show as XFAIL when bug exists (expected)
- Will show as XPASS when bug is fixed (pleasant surprise)
- Provides clear reason for expected failure
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fix all ruff lint errors in inotify test (line length, subprocess path, ternary, string wrapping)
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent e70f9a7 commit 4d35a18
2 files changed
Lines changed: 111 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
59 | 64 | | |
60 | 65 | | |
61 | 66 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
607 | 608 | | |
608 | 609 | | |
609 | 610 | | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
0 commit comments