Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfa6855b

Browse files
committed
Cloud Fetch e2e tests
Signed-off-by: Matthew Kim <11141331+mattdeekay@users.noreply.github.com>
1 parentc351b57 commitfa6855b

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

‎tests/e2e/test_driver.py‎

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
importitertools
12
fromcontextlibimportcontextmanager
23
fromcollectionsimportOrderedDict
34
importdatetime
@@ -52,6 +53,7 @@ def __init__(self, method_name):
5253
# If running in local mode, just use environment variables for params.
5354
self.arguments=os.environifget_args_from_envelse {}
5455
self.arraysize=1000
56+
self.buffer_size_bytes=10485760
5557

5658
defconnection_params(self,arguments):
5759
params= {
@@ -84,7 +86,7 @@ def connection(self, extra_params=()):
8486
@contextmanager
8587
defcursor(self,extra_params=()):
8688
withself.connection(extra_params)asconn:
87-
cursor=conn.cursor(arraysize=self.arraysize)
89+
cursor=conn.cursor(arraysize=self.arraysize,buffer_size_bytes=self.buffer_size_bytes)
8890
try:
8991
yieldcursor
9092
finally:
@@ -633,6 +635,27 @@ def test_closing_a_closed_connection_doesnt_fail(self):
633635

634636
self.assertTrue(expected_message_was_found,"Did not find expected log messages")
635637

638+
@skipUnless(pysql_supports_arrow(),'needs arrow support')
639+
deftest_cloud_fetch(self):
640+
# This test can take several minutes to run
641+
limits= [100000,600000]
642+
threads= [10,25]
643+
self.buffer_size_bytes=104857600
644+
self.arraysize=100000
645+
base_query="SELECT * FROM store_sales "
646+
fornum_limit,num_threads,lz4_compressioninitertools.product(limits,threads, [True,False]):
647+
withself.subTest(num_limit=num_limit,num_threads=num_threads,lz4_compression=lz4_compression):
648+
cf_result,noop_result=None,None
649+
query=base_query+"LIMIT "+str(num_limit)
650+
withself.cursor({"use_cloud_fetch":True,"max_download_threads":num_threads})ascursor:
651+
cursor.execute(query)
652+
cf_result=cursor.fetchall()
653+
withself.cursor({})ascursor:
654+
cursor.execute(query)
655+
noop_result=cursor.fetchall()
656+
assertlen(cf_result)==len(noop_result)
657+
foriinrange(len(cf_result)):
658+
assertcf_result[i]==noop_result[i]
636659

637660
# use a RetrySuite to encapsulate these tests which we'll typically want to run together; however keep
638661
# the 429/503 subsuites separate since they execute under different circumstances.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp