Skip to content

Commit e80d32b

Browse files
committed
fix(test): use random table name
1 parent 8c06bac commit e80d32b

2 files changed

Lines changed: 14 additions & 5 deletions

File tree

pyproject.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,9 @@
44
[tool.isort]
55
# make the tools compatible to each other
66
profile = "black"
7+
8+
[tool.pytest.ini_options]
9+
markers = [
10+
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
11+
"serial",
12+
]

src/tests/integration/test_client.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -616,38 +616,41 @@ def test_stress_test_20x_batched_selects(self, sqlitecloud_connection):
616616
query_ms < self.EXPECT_SPEED_MS
617617
), f"{num_queries}x batched selects, {query_ms}ms per query"
618618

619+
@pytest.mark.slow
619620
def test_big_rowset(self):
620621
account = SQLiteCloudAccount()
621622
account.hostname = os.getenv("SQLITE_HOST")
622623
account.apikey = os.getenv("SQLITE_API_KEY")
623624
account.dbname = os.getenv("SQLITE_DB")
624625

625626
client = SQLiteCloudClient(cloud_account=account)
627+
client.config.timeout = 100
626628

627629
connection = client.open_connection()
628630

631+
table_name = "TestCompress" + str(int(time.time()))
629632
try:
630633
client.exec_query(
631-
"CREATE TABLE IF NOT EXISTS TestCompress (id INTEGER PRIMARY KEY, name TEXT)",
634+
f"CREATE TABLE IF NOT EXISTS {table_name} (id INTEGER PRIMARY KEY, name TEXT)",
632635
connection,
633636
)
634-
client.exec_query("DELETE FROM TestCompress", connection)
635637

636-
nRows = 1000
638+
nRows = 5000
637639

638640
sql = ""
639641
for i in range(nRows):
640-
sql += f"INSERT INTO TestCompress (name) VALUES ('Test {i}'); "
642+
sql += f"INSERT INTO {table_name} (name) VALUES ('Test-{i}'); "
641643

642644
client.exec_query(sql, connection)
643645

644646
rowset = client.exec_query(
645-
"SELECT * from TestCompress",
647+
f"SELECT * from {table_name}",
646648
connection,
647649
)
648650

649651
assert rowset.nrows == nRows
650652
finally:
653+
client.exec_query(f"DROP TABLE {table_name}", connection)
651654
client.disconnect(connection)
652655

653656
def test_compression_single_column(self):

0 commit comments

Comments
 (0)