From a2093fc0e0d26b1ded2ac717a79f4d1f138cb52c Mon Sep 17 00:00:00 2001 From: John Blum Date: Wed, 17 Jul 2019 21:41:51 -0700 Subject: [PATCH] DATAGEODE-210 - Add assertion to assert that the LuceneIndex is flushed properly after data is put into the Region. --- .../lucene/LuceneOperationsIntegrationTests.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/test/java/org/springframework/data/gemfire/search/lucene/LuceneOperationsIntegrationTests.java b/src/test/java/org/springframework/data/gemfire/search/lucene/LuceneOperationsIntegrationTests.java index 7a4d605d..d00c4ded 100644 --- a/src/test/java/org/springframework/data/gemfire/search/lucene/LuceneOperationsIntegrationTests.java +++ b/src/test/java/org/springframework/data/gemfire/search/lucene/LuceneOperationsIntegrationTests.java @@ -182,8 +182,16 @@ public class LuceneOperationsIntegrationTests { LuceneService luceneService = event.getApplicationContext().getBean("luceneService", LuceneService.class); - SpringUtils.safeRunOperation(() -> - luceneService.waitUntilFlushed("PersonTitleIndex", "/People", 15L, TimeUnit.SECONDS)); + boolean flushed = SpringUtils.safeGetValue(() -> { + try { + return luceneService.waitUntilFlushed("PersonTitleIndex", "/People", 15L, TimeUnit.SECONDS); + } + catch (Throwable ignore) { + return false; + } + }); + + assertThat(flushed).describedAs("LuceneIndex not flushed!").isTrue(); } }