Skip to content

Commit

Permalink
Remove testUpdateSegmentsWhileRefreshing flaky test failure (#8943)
Browse files Browse the repository at this point in the history
Signed-off-by: Suraj Singh <surajrider@gmail.com>
(cherry picked from commit 723cab6)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] committed Jul 28, 2023
1 parent 6c5d9f2 commit 25912c1
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 25912c1

Please sign in to comment.