Skip to content

Commit

Permalink
Remove testUpdateSegmentsWhileRefreshing flaky test failure (opensear…
Browse files Browse the repository at this point in the history
…ch-project#8943)

Signed-off-by: Suraj Singh <[email protected]>
Signed-off-by: Kaushal Kumar <[email protected]>
  • Loading branch information
dreamer-89 authored and kaushalmahi12 committed Sep 12, 2023
1 parent 9613305 commit b3b2b66
Showing 1 changed file with 0 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,43 +46,4 @@ public void testCreateNRTreaderManager() throws IOException {
}
}
}

public void testUpdateSegmentsWhileRefreshing() throws IOException, InterruptedException {
try (final Store store = createStore()) {
store.createEmpty(Version.LATEST);
final DirectoryReader reader = DirectoryReader.open(store.directory());
NRTReplicationReaderManager readerManager = new NRTReplicationReaderManager(
OpenSearchDirectoryReader.wrap(reader, shardId),
(files) -> {},
(files) -> {}
);

final SegmentInfos infos_2 = readerManager.getSegmentInfos().clone();
infos_2.changed();

Thread refreshThread = new Thread(() -> {
try {
readerManager.maybeRefresh();
} catch (IOException e) {
throw new RuntimeException(e);
}
});
Thread updateThread = new Thread(() -> {
try {
readerManager.updateSegments(infos_2);
} catch (IOException e) {
throw new RuntimeException(e);
}
});
refreshThread.start();
updateThread.start();
refreshThread.join();
updateThread.join();
try (final OpenSearchDirectoryReader acquire = readerManager.acquire()) {
final StandardDirectoryReader standardReader = NRTReplicationReaderManager.unwrapStandardReader(acquire);
assertEquals(infos_2.version, standardReader.getSegmentInfos().version);
}
assertEquals(infos_2, readerManager.getSegmentInfos());
}
}
}

0 comments on commit b3b2b66

Please sign in to comment.