Skip to content

Commit

Permalink
SNOW-958531 add retries for test_null_connection (#1791)
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-mkeller authored Nov 6, 2023
1 parent 9176297 commit 16931b5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/integ/test_cursor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1613,13 +1613,21 @@ def test_fetch_batches_with_sessions(conn_cnx):

@pytest.mark.skipolddriver
def test_null_connection(conn_cnx):
retries = 15
with conn_cnx() as con:
with con.cursor() as cur:
cur.execute_async(
"select seq4() as c from table(generator(rowcount=>50000))"
)
con.rest.delete_session()
status = con.get_query_status(cur.sfqid)
for _ in range(retries):
if status not in (QueryStatus.RUNNING,):
break
time.sleep(1)
status = con.get_query_status(cur.sfqid)
else:
pytest.fail(f"query is still running after {retries} retries")
assert status == QueryStatus.FAILED_WITH_ERROR
assert con.is_an_error(status)

Expand Down

0 comments on commit 16931b5

Please sign in to comment.