Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test adjustments
  • Loading branch information
nija-at committed Apr 25, 2024
commit 95ecca6f015d8361a49804f15fb2f7a3a380b131
9 changes: 6 additions & 3 deletions python/pyspark/sql/tests/connect/test_connect_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,12 @@ def toChannel(self):

def test_reset_when_server_session_changes(self):
session = RemoteSparkSession.builder.remote("sc://localhost").getOrCreate()
session.range(3).collect() # run a simple query so the session id is synchronized.
session._client._session_id = str(uuid.uuid4()) # change the underlying session id
with self.assertRaises(Exception):
# run a simple query so the session id is synchronized.
session.range(3).collect()

# trigger a mismatch between client session id and server session id.
session._client._session_id = str(uuid.uuid4())
with self.assertRaises(SparkConnectException):
session.range(3).collect()

# assert that getOrCreate() generates a new session
Expand Down