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

Commit 7651881

Browse files
committed
use S3_URL for aws_endpoint
1 parent edceb01 commit 7651881

File tree

1 file changed

+42
-40
lines changed

1 file changed

+42
-40
lines changed

sqld/src/test/bottomless.rs

Lines changed: 42 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -30,26 +30,27 @@ async fn backup_restore() {
3030
let _ = S3BucketCleaner::new(BUCKET).await;
3131
assert_bucket_occupancy(BUCKET, true).await;
3232

33-
let listener_addr = format!("0.0.0.0:{}", PORT)
34-
.to_socket_addrs()
35-
.unwrap()
36-
.next()
37-
.unwrap();
38-
let connection_addr = Url::parse(&format!("http://localhost:{}", PORT)).unwrap();
39-
let db_config = Config {
40-
bottomless_replication: Some(bottomless::replicator::Options {
41-
create_bucket_if_not_exists: true,
42-
verify_crc: true,
43-
use_compression: bottomless::replicator::CompressionKind::Gzip,
44-
bucket_name: BUCKET.to_string(),
45-
max_batch_interval: Duration::from_millis(250),
46-
restore_transaction_page_swap_after: 1, // in this test swap should happen at least once
47-
..bottomless::replicator::Options::from_env().unwrap()
48-
}),
49-
db_path: PATH.into(),
50-
http_addr: Some(listener_addr),
51-
..Config::default()
52-
};
33+
let listener_addr = format!("0.0.0.0:{}", PORT)
34+
.to_socket_addrs()
35+
.unwrap()
36+
.next()
37+
.unwrap();
38+
let connection_addr = Url::parse(&format!("http://localhost:{}", PORT)).unwrap();
39+
let db_config = Config {
40+
bottomless_replication: Some(bottomless::replicator::Options {
41+
create_bucket_if_not_exists: true,
42+
verify_crc: true,
43+
use_compression: bottomless::replicator::CompressionKind::Gzip,
44+
bucket_name: BUCKET.to_string(),
45+
max_batch_interval: Duration::from_millis(250),
46+
restore_transaction_page_swap_after: 1, // in this test swap should happen at least once
47+
aws_endpoint: Some(S3_URL.to_string()),
48+
..bottomless::replicator::Options::from_env().unwrap()
49+
}),
50+
db_path: PATH.into(),
51+
http_addr: Some(listener_addr),
52+
..Config::default()
53+
};
5354

5455
{
5556
tracing::info!(
@@ -216,26 +217,27 @@ async fn rollback_restore() {
216217
let _ = S3BucketCleaner::new(BUCKET).await;
217218
assert_bucket_occupancy(BUCKET, true).await;
218219

219-
let listener_addr = format!("0.0.0.0:{}", PORT)
220-
.to_socket_addrs()
221-
.unwrap()
222-
.next()
223-
.unwrap();
224-
let conn = Url::parse(&format!("http://localhost:{}", PORT)).unwrap();
225-
let db_config = Config {
226-
bottomless_replication: Some(bottomless::replicator::Options {
227-
create_bucket_if_not_exists: true,
228-
verify_crc: true,
229-
use_compression: bottomless::replicator::CompressionKind::Gzip,
230-
bucket_name: BUCKET.to_string(),
231-
max_batch_interval: Duration::from_millis(250),
232-
restore_transaction_page_swap_after: 1, // in this test swap should happen at least once
233-
..bottomless::replicator::Options::from_env().unwrap()
234-
}),
235-
db_path: PATH.into(),
236-
http_addr: Some(listener_addr),
237-
..Config::default()
238-
};
220+
let listener_addr = format!("0.0.0.0:{}", PORT)
221+
.to_socket_addrs()
222+
.unwrap()
223+
.next()
224+
.unwrap();
225+
let conn = Url::parse(&format!("http://localhost:{}", PORT)).unwrap();
226+
let db_config = Config {
227+
bottomless_replication: Some(bottomless::replicator::Options {
228+
create_bucket_if_not_exists: true,
229+
verify_crc: true,
230+
use_compression: bottomless::replicator::CompressionKind::Gzip,
231+
bucket_name: BUCKET.to_string(),
232+
max_batch_interval: Duration::from_millis(250),
233+
restore_transaction_page_swap_after: 1, // in this test swap should happen at least once
234+
aws_endpoint: Some(S3_URL.to_string()),
235+
..bottomless::replicator::Options::from_env().unwrap()
236+
}),
237+
db_path: PATH.into(),
238+
http_addr: Some(listener_addr),
239+
..Config::default()
240+
};
239241

240242
{
241243
tracing::info!("---STEP 1: create db, write row, rollback---");

0 commit comments

Comments
 (0)