Skip to content

Commit d847f97

Browse files
authored
test: update error message classifier for rapid bucket creation failure again (#3115)
* test: update error message classifier for rapid bucket creation failure again * chore: case-insensitive
1 parent f58a9a7 commit d847f97

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

  • java-storage/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry

java-storage/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry/BucketInfoShim.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import com.google.cloud.storage.StorageException;
2424
import com.google.cloud.storage.it.BucketCleaner;
2525
import com.google.storage.control.v2.StorageControlClient;
26+
import java.util.Locale;
2627

2728
/** Shim to lift a BucketInfo to be a managed bucket instance */
2829
final class BucketInfoShim implements ManagedLifecycle {
@@ -53,9 +54,10 @@ public void start() {
5354
try {
5455
createdBucket = s.create(bucketInfo).asBucketInfo();
5556
} catch (StorageException se) {
56-
String msg = se.getMessage();
57+
String msg = se.getMessage().toLowerCase(Locale.US);
5758
if (se.getCode() == 400 && (msg.contains("not a valid zone in location"))
58-
|| msg.contains("custom placement config")) {
59+
|| msg.contains("custom placement config")
60+
|| msg.contains("zonal")) {
5961
assumeTrue(
6062
"Skipping test due to bucket setup unavailable in current zone. (" + msg + ")", false);
6163
}

0 commit comments

Comments
 (0)