private void verifyCreateIndexWithDifferentFieldShouldFail() throws Exception {
    AsyncInvocation<Void> ai1 = dataStore1.invokeAsync(() -> {
      createIndex("text");
    });

    AsyncInvocation<Void> ai2 = dataStore2.invokeAsync(() -> {
      createIndex("text2");
    });

    // wait for at most 10 seconds first for threads to finish
    ai1.join(10000);
    ai2.join(10000);

    // if one thread is still alive after 10 seconds, assert that they other thread throws
    // an exception and then try to create the same index on the
    // other datastore to unblock the thread and wait for the thread to finish
    if (ai1.isAlive()) {
      assertThat(ai2.getException() instanceof UnsupportedOperationException).isTrue();
      dataStore2.invoke(() -> {
        createIndex("text");
      });
      ai1.await();
    } else if (ai2.isAlive()) {
      assertThat(ai1.getException() instanceof UnsupportedOperationException).isTrue();
      dataStore1.invoke(() -> {
        createIndex("text2");
      });
      ai2.await();
    }
    // if both threads finished already, assert that both threads throw exception
    else {
      assertThat(ai1.getException() instanceof UnsupportedOperationException).isTrue();
      assertThat(ai2.getException() instanceof UnsupportedOperationException).isTrue();
    }
  }
This test class is intended to contain basic integration tests of the lucene query class that
should be executed against a number of different regions types and topologies.
geode-lucene/src/distributedTest/java/org/apache/geode/cache/lucene/LuceneQueriesReindexDUnitTest.java