Skip to content

Commit c1a9d18

Browse files
committed
Fix
1 parent 823d124 commit c1a9d18

File tree

1 file changed

+19
-17
lines changed

1 file changed

+19
-17
lines changed

fdb-record-layer-lucene/src/test/java/com/apple/foundationdb/record/lucene/LuceneIndexScrubbingTest.java

+19-17
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ void luceneIndexScrubMissingDataModelNoIssues(boolean isSynthetic, boolean isGro
9696
dataModel.saveRecords(3, i * 1007, context, i / 6);
9797
context.commit();
9898
}
99-
try (final FDBRecordContext context = openContext()) {
100-
dataModel.explicitMergeIndex(context, timer);
101-
}
99+
}
100+
try (final FDBRecordContext context = openContext()) {
101+
dataModel.explicitMergeIndex(context, timer);
102102
}
103103
try (final FDBRecordContext context = openContext()) {
104104
FDBRecordStore store = dataModel.createOrOpenRecordStore(context);
@@ -179,34 +179,36 @@ void luceneIndexScrubMissingDataModel(boolean isSynthetic, boolean isGrouped, bo
179179
dataModel.saveRecords(3, i * 1007, context, i / 6);
180180
context.commit();
181181
}
182-
try (final FDBRecordContext context = openContext()) {
183-
dataModel.explicitMergeIndex(context, timer);
184-
}
182+
}
183+
try (final FDBRecordContext context = openContext()) {
184+
dataModel.explicitMergeIndex(context, timer);
185185
}
186186

187187
try (final FDBRecordContext context = openContext()) {
188188
// Write some documents
189189
dataModel.saveRecords(7, 10, context, 1);
190190
dataModel.saveRecords(7, 20, context, 2);
191191
dataModel.saveRecords(7, 30, context, 3);
192+
}
193+
194+
try (final FDBRecordContext context = openContext()) {
195+
dataModel.explicitMergeIndex(context, timer);
196+
}
197+
198+
try (final FDBRecordContext context = openContext()) {
199+
dataModel.saveRecords(7, 40, context, 1);
200+
dataModel.saveRecords(7, 50, context, 2);
192201
// Write few more records without updating
193202
injectedFailures.setFlag(LUCENE_MAINTAINER_SKIP_INDEX_UPDATE);
203+
dataModel.saveRecords(5, 90, context, 4);
194204
dataModel.saveRecords(3, 10, context, 1);
195205
dataModel.saveRecords(2, 20, context, 3);
196206
injectedFailures.setFlag(LUCENE_MAINTAINER_SKIP_INDEX_UPDATE, false);
207+
context.commit();
208+
}
197209

198-
dataModel.saveRecords(7, 40, context, 1);
199-
dataModel.saveRecords(7, 50, context, 2);
210+
try (final FDBRecordContext context = openContext()) {
200211
dataModel.explicitMergeIndex(context, timer);
201-
202-
injectedFailures.setFlag(LUCENE_MAINTAINER_SKIP_INDEX_UPDATE);
203-
dataModel.saveRecords(5, 20, context, 4);
204-
injectedFailures.setFlag(LUCENE_MAINTAINER_SKIP_INDEX_UPDATE, false);
205-
206-
dataModel.saveRecords(7, 60, context, 3);
207-
208-
209-
context.commit();
210212
}
211213

212214
try (final FDBRecordContext context = openContext()) {

0 commit comments

Comments
 (0)