mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-06-10 13:22:45 -04:00
Fix dropping locks on shut down (#10433)
This commit is contained in:
parent
96e63ec7bf
commit
54389d5697
3 changed files with 19 additions and 1 deletions
|
@ -98,3 +98,16 @@ class LockTestCase(unittest.HomeserverTestCase):
|
|||
|
||||
lock2 = self.get_success(self.store.try_acquire_lock("name", "key"))
|
||||
self.assertIsNotNone(lock2)
|
||||
|
||||
def test_shutdown(self):
|
||||
"""Test that shutting down Synapse releases the locks"""
|
||||
# Acquire two locks
|
||||
lock = self.get_success(self.store.try_acquire_lock("name", "key1"))
|
||||
self.assertIsNotNone(lock)
|
||||
lock2 = self.get_success(self.store.try_acquire_lock("name", "key2"))
|
||||
self.assertIsNotNone(lock2)
|
||||
|
||||
# Now call the shutdown code
|
||||
self.get_success(self.store._on_shutdown())
|
||||
|
||||
self.assertEqual(self.store._live_tokens, {})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue