Skip to content

Commit f3b21ce

Browse files
committed
Make select result stable
1 parent 0fb1f72 commit f3b21ce

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/test_issue31.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
# download csv file, and unzip it
1717
def download_and_extract(url, save_path):
18-
print("Downloading file...")
18+
print("\nDownloading file...")
1919
urllib.request.urlretrieve(url, save_path)
2020

2121
print("Extracting file...")
@@ -33,13 +33,13 @@ def download_and_extract(url, save_path):
3333
def payload():
3434
now = time.time()
3535
res = chdb.query(
36-
'select Name, count(*) cnt from file("organizations-2000000.csv", CSVWithNames) group by Name order by cnt desc limit 10000',
36+
'select Name, count(*) cnt from file("organizations-2000000.csv", CSVWithNames) group by Name order by cnt desc, Name asc limit 10000',
3737
"CSV",
3838
)
3939
# calculate md5 of the result
4040
hash_out = hashlib.md5(res.get_memview().tobytes()).hexdigest()
4141
print("output length: ", len(res.get_memview().tobytes()))
42-
if hash_out != "0e86b00c00da5dbbeb3e99e5cd783252":
42+
if hash_out != "423570bd700ba230ccd2b720b7976626":
4343
print(res.get_memview().tobytes().decode("utf-8"))
4444
raise Exception(f"md5 not match {hash_out}")
4545
used_time = time.time() - now
@@ -81,7 +81,7 @@ def _test_agg(self, arg=None):
8181
payload()
8282

8383
def test_agg(self):
84-
result = TimeoutTestRunner(timeout=20).run(self._test_agg)
84+
result = TimeoutTestRunner(timeout=10).run(self._test_agg)
8585
self.assertTrue(result.wasSuccessful(), "Test failed: took too long to execute")
8686

8787

0 commit comments

Comments
 (0)