Add AsyncTestHelper for isolated EnforcerServer testing with async: true#62
Add AsyncTestHelper for isolated EnforcerServer testing with async: true#62
Conversation
|
|
Co-authored-by: hsluoyz <3787410+hsluoyz@users.noreply.github.com>
Co-authored-by: hsluoyz <3787410+hsluoyz@users.noreply.github.com>
Co-authored-by: hsluoyz <3787410+hsluoyz@users.noreply.github.com>
Co-authored-by: hsluoyz <3787410+hsluoyz@users.noreply.github.com>
Co-authored-by: hsluoyz <3787410+hsluoyz@users.noreply.github.com>
Co-authored-by: hsluoyz <3787410+hsluoyz@users.noreply.github.com>
|
@copilot fix: |
Co-authored-by: hsluoyz <3787410+hsluoyz@users.noreply.github.com>
... Fixed in fd092e4. All three files have been formatted using Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot fix: |
Co-authored-by: hsluoyz <3787410+hsluoyz@users.noreply.github.com>
... Fixed in 22602ff. The compilation error was caused by invalid list syntax on line 183. Changed from Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Async Test Isolation Implementation - COMPLETE ✅
Summary
This PR successfully resolves the issue of shared global Enforcer state breaking async tests by providing a comprehensive test helper module (
Casbin.AsyncTestHelper) that enables test isolation.Key Features
✅ Unique enforcer names per test using monotonic integers
✅ Automatic cleanup via
on_exitcallbacks✅ No breaking changes - purely additive
✅ Well documented with examples
✅ All tests pass (13 new tests)
✅ No security issues
✅ Code properly formatted per project standards
✅ Compilation verified
Changes
See PR_SUMMARY.md for detailed information.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.