mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
start testing fts pool
This commit is contained in:
parent
cb74720aa5
commit
6fb3061c56
@ -4,10 +4,11 @@
|
||||
|
||||
import builtins
|
||||
import sys
|
||||
import time
|
||||
from io import BytesIO
|
||||
|
||||
from calibre.db.tests.base import BaseTest
|
||||
from calibre.db.fts.text import html_to_text
|
||||
from calibre.db.tests.base import BaseTest
|
||||
|
||||
|
||||
def print(*args, **kwargs):
|
||||
@ -28,6 +29,14 @@ class FTSAPITest(BaseTest):
|
||||
from calibre_extensions.sqlite_extension import set_ui_language
|
||||
set_ui_language('en')
|
||||
|
||||
def test_fts_pool(self):
|
||||
cache = self.init_cache()
|
||||
fts = cache.enable_fts(start_pool=True)
|
||||
st = time.monotonic()
|
||||
while fts.all_currently_dirty() and time.monotonic() - st < 2:
|
||||
fts.pool.supervisor_thread.join(0.01)
|
||||
self.assertFalse(fts.all_currently_dirty())
|
||||
|
||||
def test_fts_triggers(self):
|
||||
cache = self.init_cache()
|
||||
fts = cache.enable_fts(start_pool=False)
|
||||
|
Loading…
x
Reference in New Issue
Block a user