aboutsummaryrefslogtreecommitdiff
path: root/src/garage
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2023-09-21 15:32:25 +0200
committerAlex Auvolat <alex@adnab.me>2023-09-21 15:35:31 +0200
commitf97168f80567f43e15cf236092703e6ae5d8dc2e (patch)
treeca9b06fa1d9bf3af9b33c5db0a8c09a53b403fa9 /src/garage
parentfd7d8fec59c617b40e480ff855894cf35fdcfb40 (diff)
downloadgarage-f97168f80567f43e15cf236092703e6ae5d8dc2e.tar.gz
garage-f97168f80567f43e15cf236092703e6ae5d8dc2e.zip
garage_db: refactor transactions and add on_commit mechanism
Diffstat (limited to 'src/garage')
-rw-r--r--src/garage/tests/common/garage.rs2
-rw-r--r--src/garage/tests/k2v/item.rs9
2 files changed, 6 insertions, 5 deletions
diff --git a/src/garage/tests/common/garage.rs b/src/garage/tests/common/garage.rs
index cb1b7ea5..d1f0867a 100644
--- a/src/garage/tests/common/garage.rs
+++ b/src/garage/tests/common/garage.rs
@@ -52,7 +52,7 @@ impl Instance {
r#"
metadata_dir = "{path}/meta"
data_dir = "{path}/data"
-db_engine = "sled"
+db_engine = "lmdb"
replication_mode = "1"
diff --git a/src/garage/tests/k2v/item.rs b/src/garage/tests/k2v/item.rs
index 25d9cce4..20add889 100644
--- a/src/garage/tests/k2v/item.rs
+++ b/src/garage/tests/k2v/item.rs
@@ -44,6 +44,7 @@ async fn test_items_and_indices() {
let content = format!("{}: hello world", sk).into_bytes();
let content2 = format!("{}: hello universe", sk).into_bytes();
let content3 = format!("{}: concurrent value", sk).into_bytes();
+ eprintln!("test iteration {}: {}", i, sk);
// Put initially, no causality token
let res = ctx
@@ -89,7 +90,7 @@ async fn test_items_and_indices() {
assert_eq!(res_body, content);
// ReadIndex -- now there should be some stuff
- tokio::time::sleep(Duration::from_secs(1)).await;
+ tokio::time::sleep(Duration::from_millis(100)).await;
let res = ctx
.k2v
.request
@@ -158,7 +159,7 @@ async fn test_items_and_indices() {
assert_eq!(res_body, content2);
// ReadIndex -- now there should be some stuff
- tokio::time::sleep(Duration::from_secs(1)).await;
+ tokio::time::sleep(Duration::from_millis(100)).await;
let res = ctx
.k2v
.request
@@ -230,7 +231,7 @@ async fn test_items_and_indices() {
);
// ReadIndex -- now there should be some stuff
- tokio::time::sleep(Duration::from_secs(1)).await;
+ tokio::time::sleep(Duration::from_millis(100)).await;
let res = ctx
.k2v
.request
@@ -299,7 +300,7 @@ async fn test_items_and_indices() {
assert_eq!(res.status(), StatusCode::NO_CONTENT);
// ReadIndex -- now there should be some stuff
- tokio::time::sleep(Duration::from_secs(1)).await;
+ tokio::time::sleep(Duration::from_millis(100)).await;
let res = ctx
.k2v
.request