From c7799c8ec5ace4dbe3ef87f36bff6e5cc89d7491 Mon Sep 17 00:00:00 2001 From: pedrocarlo Date: Mon, 9 Jun 2025 16:15:00 -0300 Subject: [PATCH 1/2] add sleep to allow file lock to be removed --- testing/cli_tests/write.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/testing/cli_tests/write.py b/testing/cli_tests/write.py index 09134b341..9cc91607d 100755 --- a/testing/cli_tests/write.py +++ b/testing/cli_tests/write.py @@ -4,6 +4,7 @@ import tempfile from cli_tests.test_limbo_cli import TestLimboShell from pydantic import BaseModel from cli_tests import console +from time import sleep sqlite_flags = os.getenv("SQLITE_FLAGS", "-q").split(" ") @@ -37,7 +38,7 @@ class InsertTest(BaseModel): big_stmt.append("SELECT count(*) FROM test;") expected.append(str(self.vals * 2)) - + big_stmt.append("DELETE FROM temp;") big_stmt.append("SELECT count(*) FROM temp;") expected.append(str(0)) @@ -140,14 +141,14 @@ def main(): tests = blob_tests() for test in tests: console.info(test) - with tempfile.NamedTemporaryFile(suffix='.db') as tmp: + with tempfile.NamedTemporaryFile(suffix=".db") as tmp: test.db_path = tmp.name try: # Use with syntax to automatically close shell on error with TestLimboShell("") as limbo: limbo.execute_dot(f".open {test.db_path}") test.run(limbo) - + sleep(0.3) test.test_compat() except Exception as e: From 3e0549607873fd025ba71fd68c8f827d35dd8cdd Mon Sep 17 00:00:00 2001 From: pedrocarlo Date: Mon, 9 Jun 2025 17:44:00 -0300 Subject: [PATCH 2/2] add integrity check to write tests --- testing/cli_tests/write.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/testing/cli_tests/write.py b/testing/cli_tests/write.py index 9cc91607d..8c0d91943 100755 --- a/testing/cli_tests/write.py +++ b/testing/cli_tests/write.py @@ -73,6 +73,11 @@ class InsertTest(BaseModel): lambda res: res == str(self.vals * 2), "Counting total rows inserted", ) + sqlite.run_test_fn( + "PRAGMA integrity_check;", + lambda res: res == "ok", + "Integrity Check", + ) console.info()