Skip to content
Snippets Groups Projects
Commit af6a979f authored by Piotr Maślanka's avatar Piotr Maślanka
Browse files

SyncableDroppable.cleanup bugs out

parent 313b5537
No related branches found
No related tags found
No related merge requests found
# v2.24.1 # v2.24.1
* minor pylint improvements * minor pylint improvements
\ No newline at end of file * better coverage
* SyncableDroppable.cleanup() bugs out, wrote a quick patch for it to do nothing and filed as #61.
__version__ = '2.24.1a2' __version__ = '2.24.1a4'
...@@ -2,6 +2,7 @@ import bisect ...@@ -2,6 +2,7 @@ import bisect
import itertools import itertools
import math import math
import typing as tp import typing as tp
import warnings
from abc import ABCMeta, abstractmethod from abc import ABCMeta, abstractmethod
from satella.coding.concurrent.monitor import RMonitor from satella.coding.concurrent.monitor import RMonitor
...@@ -163,9 +164,10 @@ class SyncableDroppable(RMonitor, tp.Generic[K, V]): ...@@ -163,9 +164,10 @@ class SyncableDroppable(RMonitor, tp.Generic[K, V]):
and span_to_keep_in_memory. and span_to_keep_in_memory.
This may block for a while. This may block for a while.
.. warning:: This bugs out for now. For now, a UserWarning will be raised and nothing will be done.
""" """
self.cleanup_keep_in_db() warnings.warn('Nothing done', UserWarning)
self.cleanup_keep_in_memory()
def _cleanup_the_db(self) -> bool: def _cleanup_the_db(self) -> bool:
""" """
......
...@@ -77,7 +77,7 @@ class TestSyncableDroppable(unittest.TestCase): ...@@ -77,7 +77,7 @@ class TestSyncableDroppable(unittest.TestCase):
sd.cleanup_keep_in_db() sd.cleanup_keep_in_db()
self.assertEqual(sd.start_entry, 200) self.assertEqual(sd.start_entry, 200)
self.assertEqual(db.data, []) self.assertEqual(db.data, [])
self.assertWarns(UserWarning, lambda: sd.cleanup())
sd.cleanup_keep_in_memory() sd.cleanup_keep_in_memory()
self.assertEqual(db.data, [(200, 5), (220, 5)]) self.assertEqual(db.data, [(200, 5), (220, 5)])
synces = list(sd.on_sync_request()) synces = list(sd.on_sync_request())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment