Fix frozen delta watermark and add error stats, lazy source, concurrent disk reads, and per-engine config
This commit is contained in:
@@ -73,6 +73,29 @@ def test_counters_still_reported(source_engine, patched_cache):
|
||||
engine.close()
|
||||
|
||||
|
||||
def test_stats_exposes_table_error(source_engine, patched_cache):
|
||||
engine = CachingEngine(source_engine)
|
||||
engine.execute("SELECT id, name FROM products")
|
||||
engine._cache.record_error("products", "ValueError: boom")
|
||||
|
||||
s = engine.stats
|
||||
assert s.errors == 1
|
||||
assert s.tables["products"].consecutive_failures == 1
|
||||
assert s.tables["products"].last_error == "ValueError: boom"
|
||||
assert s.tables["products"].last_error_at is not None
|
||||
engine.close()
|
||||
|
||||
|
||||
def test_stats_no_error_by_default(source_engine, patched_cache):
|
||||
engine = CachingEngine(source_engine)
|
||||
engine.execute("SELECT id, name FROM products")
|
||||
s = engine.stats
|
||||
assert s.errors == 0
|
||||
assert s.tables["products"].consecutive_failures == 0
|
||||
assert s.tables["products"].last_error is None
|
||||
engine.close()
|
||||
|
||||
|
||||
# --- a table being loaded for the first time shows up as "loading" ----------
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user