summaryrefslogtreecommitdiffstats
path: root/searchlib/src/tests/diskindex/fusion/fusion_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'searchlib/src/tests/diskindex/fusion/fusion_test.cpp')
-rw-r--r--searchlib/src/tests/diskindex/fusion/fusion_test.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/searchlib/src/tests/diskindex/fusion/fusion_test.cpp b/searchlib/src/tests/diskindex/fusion/fusion_test.cpp
index 72867edf474..37fac07a8d4 100644
--- a/searchlib/src/tests/diskindex/fusion/fusion_test.cpp
+++ b/searchlib/src/tests/diskindex/fusion/fusion_test.cpp
@@ -63,12 +63,14 @@ class FusionTest : public ::testing::Test
{
protected:
Schema _schema;
+ bool _force_small_merge_chunk;
const Schema & getSchema() const { return _schema; }
void requireThatFusionIsWorking(const vespalib::string &prefix, bool directio, bool readmmap, bool force_short_merge_chunk);
void make_simple_index(const vespalib::string &dump_dir, const IFieldLengthInspector &field_length_inspector);
bool try_merge_simple_indexes(const vespalib::string &dump_dir, const std::vector<vespalib::string> &sources, std::shared_ptr<IFlushToken> flush_token);
void merge_simple_indexes(const vespalib::string &dump_dir, const std::vector<vespalib::string> &sources);
+ void reconstruct_interleaved_features();
public:
FusionTest();
};
@@ -494,6 +496,7 @@ FusionTest::try_merge_simple_indexes(const vespalib::string &dump_dir, const std
SelectorArray selector(20, 0);
Fusion fusion(_schema, dump_dir, sources, selector,
tuneFileIndexing, fileHeaderContext);
+ fusion.set_force_small_merge_chunk(_force_small_merge_chunk);
return fusion.merge(executor, flush_token);
}
@@ -505,7 +508,8 @@ FusionTest::merge_simple_indexes(const vespalib::string &dump_dir, const std::ve
FusionTest::FusionTest()
: ::testing::Test(),
- _schema(make_schema(false))
+ _schema(make_schema(false)),
+ _force_small_merge_chunk(false)
{
}
@@ -557,7 +561,8 @@ TEST_F(FusionTest, require_that_average_field_length_is_preserved)
clean_field_length_testdirs();
}
-TEST_F(FusionTest, require_that_interleaved_features_can_be_reconstructed)
+void
+FusionTest::reconstruct_interleaved_features()
{
clean_field_length_testdirs();
make_simple_index("fldump2", MockFieldLengthInspector());
@@ -573,6 +578,17 @@ TEST_F(FusionTest, require_that_interleaved_features_can_be_reconstructed)
clean_field_length_testdirs();
}
+TEST_F(FusionTest, require_that_interleaved_features_can_be_reconstructed)
+{
+ reconstruct_interleaved_features();
+}
+
+TEST_F(FusionTest, require_that_interleaved_features_can_be_reconstructed_with_small_merge_chunk)
+{
+ _force_small_merge_chunk = true;
+ reconstruct_interleaved_features();
+}
+
namespace {
void clean_stopped_fusion_testdirs()