Skip to content
This repository was archived by the owner on Oct 18, 2023. It is now read-only.

Commit edceb01

Browse files
committed
cleanup S3 bucket using guard
1 parent 2ffd4ef commit edceb01

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

sqld/src/test/bottomless.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ fn start_db(step: u32, config: &Config) -> JoinHandle<()> {
1919
})
2020
}
2121

22-
#[tokio::test]
22+
#[tokio::test(flavor = "multi_thread")]
2323
async fn backup_restore() {
2424
let _ = env_logger::builder().is_test(true).try_init();
2525
const BUCKET: &str = "testbackuprestore";
@@ -192,7 +192,7 @@ async fn backup_restore() {
192192
}
193193
}
194194

195-
#[tokio::test]
195+
#[tokio::test(flavor = "multi_thread")]
196196
async fn rollback_restore() {
197197
let _ = env_logger::builder().is_test(true).try_init();
198198
const BUCKET: &str = "testrollbackrestore";
@@ -416,7 +416,8 @@ impl S3BucketCleaner {
416416

417417
impl Drop for S3BucketCleaner {
418418
fn drop(&mut self) {
419-
//FIXME: running line below on tokio::test runtime will hang.
420-
//let _ = block_on(Self::cleanup(self.0));
419+
tokio::task::block_in_place(|| {
420+
let _ = tokio::runtime::Handle::current().block_on(Self::cleanup(self.0));
421+
});
421422
}
422423
}

0 commit comments

Comments
 (0)