mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-18 17:14:20 +01:00
add sleep to allow file lock to be removed
This commit is contained in:
@@ -4,6 +4,7 @@ import tempfile
|
|||||||
from cli_tests.test_limbo_cli import TestLimboShell
|
from cli_tests.test_limbo_cli import TestLimboShell
|
||||||
from pydantic import BaseModel
|
from pydantic import BaseModel
|
||||||
from cli_tests import console
|
from cli_tests import console
|
||||||
|
from time import sleep
|
||||||
|
|
||||||
|
|
||||||
sqlite_flags = os.getenv("SQLITE_FLAGS", "-q").split(" ")
|
sqlite_flags = os.getenv("SQLITE_FLAGS", "-q").split(" ")
|
||||||
@@ -37,7 +38,7 @@ class InsertTest(BaseModel):
|
|||||||
|
|
||||||
big_stmt.append("SELECT count(*) FROM test;")
|
big_stmt.append("SELECT count(*) FROM test;")
|
||||||
expected.append(str(self.vals * 2))
|
expected.append(str(self.vals * 2))
|
||||||
|
|
||||||
big_stmt.append("DELETE FROM temp;")
|
big_stmt.append("DELETE FROM temp;")
|
||||||
big_stmt.append("SELECT count(*) FROM temp;")
|
big_stmt.append("SELECT count(*) FROM temp;")
|
||||||
expected.append(str(0))
|
expected.append(str(0))
|
||||||
@@ -140,14 +141,14 @@ def main():
|
|||||||
tests = blob_tests()
|
tests = blob_tests()
|
||||||
for test in tests:
|
for test in tests:
|
||||||
console.info(test)
|
console.info(test)
|
||||||
with tempfile.NamedTemporaryFile(suffix='.db') as tmp:
|
with tempfile.NamedTemporaryFile(suffix=".db") as tmp:
|
||||||
test.db_path = tmp.name
|
test.db_path = tmp.name
|
||||||
try:
|
try:
|
||||||
# Use with syntax to automatically close shell on error
|
# Use with syntax to automatically close shell on error
|
||||||
with TestLimboShell("") as limbo:
|
with TestLimboShell("") as limbo:
|
||||||
limbo.execute_dot(f".open {test.db_path}")
|
limbo.execute_dot(f".open {test.db_path}")
|
||||||
test.run(limbo)
|
test.run(limbo)
|
||||||
|
sleep(0.3)
|
||||||
test.test_compat()
|
test.test_compat()
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|||||||
Reference in New Issue
Block a user