Skip to content

Commit 302dba5

Browse files
authored
test(storage): one less flaky create_bucket() (#3595)
1 parent 7512650 commit 302dba5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/storage/examples/src/quickstart.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
// limitations under the License.
1414

1515
// [START storage_quickstart]
16+
use google_cloud_gax::options::RequestOptionsBuilder;
1617
use google_cloud_storage::{client::StorageControl, model::Bucket};
1718

1819
pub async fn sample(
@@ -30,6 +31,8 @@ pub async fn sample(
3031
.set_storage_class("STANDARD")
3132
.set_location("US"),
3233
)
34+
// This is an idempotent request: it can only succeed once.
35+
.with_idempotency(true)
3336
.send()
3437
.await?;
3538
println!("successfully created bucket {bucket:?}");

0 commit comments

Comments
 (0)