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