hsluoyz commented on issue #31:
URL: https://github.com/apache/casbin-ex/issues/31#issuecomment-5207230918

   @sushilbansal  Fixed in 
https://github.com/casbin/casbin-ex/commit/8ce8df347e7ffa8302188684c8a957a7f609cecb.
   
   The root cause was that an enforcer could never be torn down: it was 
supervised with `restart: :permanent`, and its state was cached in a global ETS 
table keyed by name that was never cleared — so even unique-per-test names 
leaked, and reusing a name silently resurrected the old policies. There's now 
`EnforcerSupervisor.stop_enforcer/1`, which stops the process and drops its 
cached state, so each test can use its own enforcer name and clean it up in 
`on_exit/1` and run with `async: true`. See the [[test isolation 
guide](https://github.com/casbin/casbin-ex/blob/master/guides/test_isolation.md)](https://github.com/casbin/casbin-ex/blob/master/guides/test_isolation.md)
 for the pattern. Crash recovery is unchanged — a crashed enforcer still 
restarts with its previous policies.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to