nastra commented on code in PR #16109:
URL: https://github.com/apache/iceberg/pull/16109#discussion_r3154261741


##########
gcp/src/test/java/org/apache/iceberg/gcp/gcs/TestGCSFileIO.java:
##########
@@ -575,4 +577,22 @@ public void resolvingFileIOLoadWithStorageCredentials(
         .extracting(GCSFileIO::credentials)
         .isEqualTo(storageCredentials);
   }
+
+  @Test
+  @SuppressWarnings("unchecked")
+  public void setCredentialsPublishesThreadSafeSnapshot() throws Exception {
+    StorageCredential credential =
+        StorageCredential.create("gs://bucket/path", ImmutableMap.of("key1", 
"val1"));
+
+    try (GCSFileIO fileIO = new GCSFileIO()) {
+      List<StorageCredential> input = Lists.newArrayList();
+      input.add(credential);
+      fileIO.setCredentials(input);
+
+      Field field = GCSFileIO.class.getDeclaredField("storageCredentials");
+      field.setAccessible(true);
+      List<StorageCredential> stored = (List<StorageCredential>) 
field.get(fileIO);

Review Comment:
   I'm not sure I understand what this is trying to test exactly, but if you're 
suspecting a concurrency issue, then we should have a test that reproduces that 
concurrency issue



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to