Skip to content

Commit

Permalink
fix tests to actually repro
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-rcheng committed Oct 20, 2023
1 parent 6996af5 commit 09b2d62
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"topics": "SNOWFLAKE_TEST_TOPIC0,SNOWFLAKE_TEST_TOPIC1",
"snowflake.topic2table.map": "SNOWFLAKE_TEST_TOPIC0:SNOWFLAKE_CONNECTOR_NAME,SNOWFLAKE_TEST_TOPIC1:SNOWFLAKE_CONNECTOR_NAME",
"tasks.max": "1",
"buffer.flush.time": "10",
"buffer.flush.time": "60",
"buffer.count.records": "300",
"buffer.size.bytes": "5000000",
"snowflake.url.name": "SNOWFLAKE_HOST",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"topics": "SNOWFLAKE_TEST_TOPIC0,SNOWFLAKE_TEST_TOPIC1",
"snowflake.topic2table.map": "SNOWFLAKE_TEST_TOPIC0:SNOWFLAKE_CONNECTOR_NAME,SNOWFLAKE_TEST_TOPIC1:SNOWFLAKE_CONNECTOR_NAME",
"tasks.max": "1",
"buffer.flush.time": "10",
"buffer.flush.time": "60",
"buffer.count.records": "300",
"buffer.size.bytes": "5000000",
"snowflake.url.name": "SNOWFLAKE_HOST",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,12 @@ def send(self):
value.append(self.records[i])
self.driver.sendAvroSRData(topic, value, self.valueSchema[i], key=[], key_schema="", partition=0)

sleep(2)

# send second batch that should flush
value = []
for _ in range(self.flushRecordCount):
value.append(self.records[i])
self.driver.sendAvroSRData(topic, value, self.valueSchema[i], key=[], key_schema="", partition=0)

sleep(10) # sleep to ensure all data is flushed

def verify(self, round):
rows = self.driver.snowflake_conn.cursor().execute(
"desc table {}".format(self.table)).fetchall()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ def send(self):
value.append(json.dumps(self.records[i]).encode('utf-8'))
self.driver.sendBytesData(topic, value, key)

sleep(2)

# send second batch that should flush
key = []
value = []
Expand All @@ -71,9 +69,8 @@ def send(self):
value.append(json.dumps(self.records[i]).encode('utf-8'))
self.driver.sendBytesData(topic, value, key)

sleep(10) # sleep to ensure all data is flushed

def verify(self, round):
sleep(60)
rows = self.driver.snowflake_conn.cursor().execute(
"desc table {}".format(self.table)).fetchall()
res_col = {}
Expand Down

0 comments on commit 09b2d62

Please sign in to comment.