test: fix testing deadlocks
The MemCatalog suffers from deadlocks when attempting to obtain a second
ref to RepoCollection:
@@ -720,6 +720,7 @@ mod tests {
let object_store: Arc<DynObjectStore> = Arc::new(InMemory::new());
+ drop(repos); // test catalog deadlock
let data = Arc::new(
IngesterData::new(
Arc::clone(&object_store),
@@ -733,6 +734,8 @@ mod tests {
.expect("failed to initialise ingester"),
);
+ let mut repos = catalog.repositories().await;
+
let schema = NamespaceSchema::new(namespace.id, topic.id, query_pool.id, 100);
let ignored_ts = Time::from_timestamp_millis(42);
@@ -824,6 +827,7 @@ mod tests {
let object_store: Arc<DynObjectStore> = Arc::new(InMemory::new());
+ drop(repos); // test catalog deadlock
let data = Arc::new(
IngesterData::new(
Arc::clone(&object_store),
@@ -837,6 +841,8 @@ mod tests {
.expect("failed to initialise ingester"),
);
+ let mut repos = catalog.repositories().await;
+
let schema = NamespaceSchema::new(namespace.id, topic.id, query_pool.id, 100);
let batch = lines_to_batches("mem foo=1 10\nmem foo=1 11", 0).unwrap();
@@ -935,6 +941,7 @@ mod tests {
let object_store: Arc<DynObjectStore> = Arc::new(InMemory::new());
+ drop(repos); // test catalog deadlock
let data = Arc::new(
IngesterData::new(
Arc::clone(&object_store),
@@ -951,6 +958,8 @@ mod tests {
.expect("failed to initialise ingester"),
);
+ let mut repos = catalog.repositories().await;
+
let schema = NamespaceSchema::new(namespace.id, topic.id, query_pool.id, 100);
let ignored_ts = Time::from_timestamp_millis(42);
@@ -1218,6 +1227,7 @@ mod tests {
let object_store: Arc<DynObjectStore> = Arc::new(InMemory::new());
+ drop(repos); // test catalog deadlock
let data = Arc::new(
IngesterData::new(
Arc::clone(&object_store),
@@ -1234,6 +1244,8 @@ mod tests {
.expect("failed to initialise ingester"),
);
+ let mut repos = catalog.repositories().await;
+
let schema = NamespaceSchema::new(namespace.id, topic.id, query_pool.id, 100);
let ignored_ts = Time::from_timestamp_millis(42);
@@ -1539,6 +1551,7 @@ mod tests {
let object_store: Arc<DynObjectStore> = Arc::new(InMemory::new());
+ drop(repos); // test catalog deadlock
let data = Arc::new(
IngesterData::new(
Arc::clone(&object_store),
@@ -1552,6 +1565,8 @@ mod tests {
.expect("failed to initialise ingester"),
);
+ let mut repos = catalog.repositories().await;
+
let schema = NamespaceSchema::new(namespace.id, topic.id, query_pool.id, 100);
let ignored_ts = Time::from_timestamp_millis(42);
