diff --git a/sqld/src/test/bottomless.rs b/sqld/src/test/bottomless.rs index 66e6ef95..ee5fc8a2 100644 --- a/sqld/src/test/bottomless.rs +++ b/sqld/src/test/bottomless.rs @@ -19,7 +19,7 @@ fn start_db(step: u32, config: &Config) -> JoinHandle<()> { }) } -#[tokio::test] +#[tokio::test(flavor = "multi_thread")] async fn backup_restore() { let _ = env_logger::builder().is_test(true).try_init(); const BUCKET: &str = "testbackuprestore"; @@ -44,6 +44,7 @@ async fn backup_restore() { bucket_name: BUCKET.to_string(), max_batch_interval: Duration::from_millis(250), restore_transaction_page_swap_after: 1, // in this test swap should happen at least once + aws_endpoint: Some(S3_URL.to_string()), ..bottomless::replicator::Options::from_env().unwrap() }), db_path: PATH.into(), @@ -192,7 +193,7 @@ async fn backup_restore() { } } -#[tokio::test] +#[tokio::test(flavor = "multi_thread")] async fn rollback_restore() { let _ = env_logger::builder().is_test(true).try_init(); const BUCKET: &str = "testrollbackrestore"; @@ -230,6 +231,7 @@ async fn rollback_restore() { bucket_name: BUCKET.to_string(), max_batch_interval: Duration::from_millis(250), restore_transaction_page_swap_after: 1, // in this test swap should happen at least once + aws_endpoint: Some(S3_URL.to_string()), ..bottomless::replicator::Options::from_env().unwrap() }), db_path: PATH.into(), @@ -416,7 +418,8 @@ impl S3BucketCleaner { impl Drop for S3BucketCleaner { fn drop(&mut self) { - //FIXME: running line below on tokio::test runtime will hang. - //let _ = block_on(Self::cleanup(self.0)); + tokio::task::block_in_place(|| { + let _ = tokio::runtime::Handle::current().block_on(Self::cleanup(self.0)); + }); } }