Skip to content

Commit 6fbd225

Browse files
authored
SNOW-2444867 Fix testPutGetToUnencryptedStage (#2387)
1 parent 652b060 commit 6fbd225

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/test/java/net/snowflake/client/jdbc/SnowflakeDriverIT.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2736,6 +2736,7 @@ public void testPutGetToUnencryptedStage() throws Throwable {
27362736
accountName = "gcpaccount";
27372737
SnowflakeUtil.systemSetEnv("SNOWFLAKE_GCS_FORCE_VIRTUAL_STYLE_DOMAINS", "true");
27382738
}
2739+
String stageName = "testPutGet_unencstage_" + SnowflakeUtil.randomAlphaNumeric(10);
27392740
try (Connection connection = getConnection(accountName);
27402741
Statement statement = connection.createStatement()) {
27412742
try {
@@ -2748,18 +2749,18 @@ public void testPutGetToUnencryptedStage() throws Throwable {
27482749

27492750
statement.execute("alter session set ENABLE_GCP_PUT_EXCEPTION_FOR_OLD_DRIVERS=false");
27502751
statement.execute(
2751-
"CREATE OR REPLACE STAGE testPutGet_unencstage encryption=(TYPE='SNOWFLAKE_SSE')");
2752+
"CREATE OR REPLACE STAGE " + stageName + " encryption=(TYPE='SNOWFLAKE_SSE')");
27522753

27532754
assertTrue(
2754-
statement.execute("PUT file://" + sourceFilePath + " @testPutGet_unencstage"),
2755+
statement.execute("PUT file://" + sourceFilePath + " @" + stageName),
27552756
"Failed to put a file");
27562757

2757-
findFile(statement, "ls @testPutGet_unencstage/");
2758+
findFile(statement, "ls @" + stageName + "/");
27582759

27592760
// download the file we just uploaded to stage
27602761
assertTrue(
27612762
statement.execute(
2762-
"GET @testPutGet_unencstage 'file://" + destFolderCanonicalPath + "' parallel=8"),
2763+
"GET @" + stageName + " 'file://" + destFolderCanonicalPath + "' parallel=8"),
27632764
"Failed to get a file");
27642765

27652766
// Make sure that the downloaded file exists, it should be gzip compressed
@@ -2775,7 +2776,7 @@ public void testPutGetToUnencryptedStage() throws Throwable {
27752776
File unzipped = new File(destFolderCanonicalPathWithSeparator + TEST_DATA_FILE);
27762777
assertEquals(original.length(), unzipped.length());
27772778
} finally {
2778-
statement.execute("DROP STAGE IF EXISTS testPutGet_unencstage");
2779+
statement.execute("DROP STAGE IF EXISTS " + stageName);
27792780
}
27802781
} finally {
27812782
SnowflakeUtil.systemSetEnv("SNOWFLAKE_GCS_FORCE_VIRTUAL_STYLE_DOMAINS", "false");

0 commit comments

Comments
 (0)