mirror of
https://github.com/quickwit-oss/tantivy.git
synced 2026-05-25 20:50:43 +00:00
added tests for correct handling of lockfiles
This commit is contained in:
@@ -310,6 +310,28 @@ mod tests {
|
||||
use Index;
|
||||
use Term;
|
||||
|
||||
#[test]
|
||||
#[should_panic]
|
||||
fn test_lockfile_stops_duplicates() {
|
||||
|
||||
let mut schema_builder = schema::SchemaBuilder::default();
|
||||
let text_field = schema_builder.add_text_field("text", schema::TEXT);
|
||||
let index = Index::create_in_ram(schema_builder.build());
|
||||
let index_writer = index.writer(40_000_000).unwrap();
|
||||
let index_writer_two = index.writer(40_000_000).unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_lockfile_released_on_drop() {
|
||||
let mut schema_builder = schema::SchemaBuilder::default();
|
||||
let text_field = schema_builder.add_text_field("text", schema::TEXT);
|
||||
let index = Index::create_in_ram(schema_builder.build());
|
||||
{
|
||||
let index_writer = index.writer(40_000_000).unwrap();
|
||||
}
|
||||
|
||||
let index_writer_two = index.writer(40_000_000).unwrap();
|
||||
}
|
||||
#[test]
|
||||
fn test_commit_and_rollback() {
|
||||
let mut schema_builder = schema::SchemaBuilder::default();
|
||||
|
||||
Reference in New Issue
Block a user