From 4cdfdddd6dda629ab8d86be931a6a349ecfd9ade Mon Sep 17 00:00:00 2001 From: Louis Dureuil Date: Wed, 20 Nov 2024 11:35:01 +0100 Subject: [PATCH] Fix one more --- crates/milli/tests/search/facet_distribution.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/crates/milli/tests/search/facet_distribution.rs b/crates/milli/tests/search/facet_distribution.rs index c665109db..93c1da7bd 100644 --- a/crates/milli/tests/search/facet_distribution.rs +++ b/crates/milli/tests/search/facet_distribution.rs @@ -25,10 +25,12 @@ fn test_facet_distribution_with_no_facet_values() { S("tags"), }); builder.execute(|_| (), || false).unwrap(); + wtxn.commit().unwrap(); // index documents let config = IndexerConfig { max_memory: Some(10 * 1024 * 1024), ..Default::default() }; let rtxn = index.read_txn().unwrap(); + let mut wtxn = index.write_txn().unwrap(); let db_fields_ids_map = index.fields_ids_map(&rtxn).unwrap(); let mut new_fields_ids_map = db_fields_ids_map.clone(); @@ -66,13 +68,13 @@ fn test_facet_distribution_with_no_facet_values() { wtxn.commit().unwrap(); - let txn = index.read_txn().unwrap(); - let mut distrib = FacetDistribution::new(&txn, &index); + let rtxn = index.read_txn().unwrap(); + let mut distrib = FacetDistribution::new(&rtxn, &index); distrib.facets(vec![("genres", OrderBy::default())]); let result = distrib.execute().unwrap(); assert_eq!(result["genres"].len(), 0); - let mut distrib = FacetDistribution::new(&txn, &index); + let mut distrib = FacetDistribution::new(&rtxn, &index); distrib.facets(vec![("tags", OrderBy::default())]); let result = distrib.execute().unwrap(); assert_eq!(result["tags"].len(), 2);