Skip to content

Commit

Permalink
SNOW-954959: Don't create newSession when running test in SP (#71)
Browse files Browse the repository at this point in the history
don't create newSession when running test in SP
  • Loading branch information
sfc-gh-smirzaei authored and sfc-gh-bli committed Dec 4, 2023
1 parent 5f87605 commit eb73f8a
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@ class AsyncJobSuite extends TestData with BeforeAndAfterEach {
super.beforeAll()
// create temporary stage to store the file
runQuery(s"CREATE TEMPORARY STAGE $tmpStageName", session)
runQuery(s"CREATE TEMPORARY STAGE $tmpStageName", newSession)
// Create temp target stage for writing DF to file test.
runQuery(s"CREATE TEMPORARY STAGE $targetStageName", session)
// upload the file to stage
uploadFileToStage(tmpStageName, testFileCsv, compress = false)
if (!isStoredProc(session)) {
// create temporary stage to store the file
runQuery(s"CREATE TEMPORARY STAGE $tmpStageName", newSession)
TestUtils.addDepsToClassPath(session, Some(tmpStageName))
// In stored procs mode, there is only one session
TestUtils.addDepsToClassPath(newSession, Some(tmpStageName))
Expand All @@ -45,7 +46,9 @@ class AsyncJobSuite extends TestData with BeforeAndAfterEach {
override def afterAll(): Unit = {
// drop the temporary stages
runQuery(s"DROP STAGE IF EXISTS $tmpStageName", session)
runQuery(s"DROP STAGE IF EXISTS $tmpStageName", newSession)
if (!isStoredProc(session)) {
runQuery(s"DROP STAGE IF EXISTS $tmpStageName", newSession)
}
dropTable(tableName)
dropTable(tableName1)
dropTable(tableName2)
Expand Down

0 comments on commit eb73f8a

Please sign in to comment.