cargo: update to fail 0.3 (#593)

* cargo: update to fail 0.3

* tantivy: align failpoints feature naming

This aligns feature naming to use `failpoints` everywhere, like the
underlying library.
This commit is contained in:
Luca Bruno
2019-07-17 09:51:38 +00:00
committed by Paul Masurel
parent af7ea1422a
commit 4e6dcf3cbe
3 changed files with 7 additions and 8 deletions

View File

@@ -49,7 +49,7 @@ fnv = "1.0.6"
owned-read = "0.4"
failure = "0.1"
htmlescape = "0.3.1"
fail = "0.2"
fail = "0.3"
scoped-pool = "1.0"
murmurhash32 = "0.2"
chrono = "0.4"
@@ -74,11 +74,10 @@ debug-assertions = true
overflow-checks = true
[features]
# by default no-fail is disabled. We manually enable it when running test.
default = ["mmap", "no_fail"]
default = ["mmap"]
mmap = ["atomicwrites", "fs2", "memmap", "notify"]
lz4-compression = ["lz4"]
no_fail = ["fail/no_fail"]
failpoints = ["fail/failpoints"]
unstable = [] # useful for benches.
wasm-bindgen = ["uuid/wasm-bindgen"]

View File

@@ -1,2 +1,2 @@
#!/bin/bash
cargo test --no-default-features --features mmap -- --test-threads 1
cargo test --features "failpoints"

View File

@@ -931,6 +931,7 @@ mod tests {
#[test]
fn test_with_merges() {
let _guard = fail::FailScenario::setup();
let mut schema_builder = schema::Schema::builder();
let text_field = schema_builder.add_text_field("text", schema::TEXT);
let index = Index::create_in_ram(schema_builder.build());
@@ -1041,10 +1042,10 @@ mod tests {
assert_eq!(num_docs_containing("b"), 100);
}
#[cfg(not(feature = "no_fail"))]
#[cfg(feature = "failpoints")]
#[test]
fn test_write_commit_fails() {
use fail;
let _guard = fail::FailScenario::setup();
let mut schema_builder = schema::Schema::builder();
let text_field = schema_builder.add_text_field("text", schema::TEXT);
let index = Index::create_in_ram(schema_builder.build());
@@ -1065,7 +1066,6 @@ mod tests {
};
assert_eq!(num_docs_containing("a"), 100);
assert_eq!(num_docs_containing("b"), 0);
fail::cfg("RAMDirectory::atomic_write", "off").unwrap();
}
#[test]