Skip to content

Commit

Permalink
fix flaky test (#2107)
Browse files Browse the repository at this point in the history
closes #2099
  • Loading branch information
PSeitz authored Jun 29, 2023
1 parent 040554f commit 3fef052
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/query/range_query/range_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,7 @@ mod tests {

use super::RangeQuery;
use crate::collector::{Count, TopDocs};
use crate::indexer::NoMergePolicy;
use crate::query::QueryParser;
use crate::schema::{Document, Field, IntoIpv6Addr, Schema, FAST, INDEXED, STORED, TEXT};
use crate::{doc, Index};
Expand Down Expand Up @@ -547,7 +548,8 @@ mod tests {

let index = Index::create_in_ram(schema);
{
let mut index_writer = index.writer_with_num_threads(2, 60_000_000)?;
let mut index_writer = index.writer_with_num_threads(1, 60_000_000)?;
index_writer.set_merge_policy(Box::new(NoMergePolicy));

for i in 1..100 {
let mut doc = Document::new();
Expand All @@ -557,6 +559,9 @@ mod tests {
}
}
index_writer.add_document(doc)?;
if i == 10 {
index_writer.commit()?;
}
}

index_writer.commit()?;
Expand Down

0 comments on commit 3fef052

Please sign in to comment.