Skip to content

Commit 90f2f3f

Browse files
committed
Remove testUpdateSegmentsWhileRefreshing flaky test failure
Signed-off-by: Suraj Singh <[email protected]>
1 parent 91bc891 commit 90f2f3f

File tree

1 file changed

+0
-39
lines changed

1 file changed

+0
-39
lines changed

server/src/test/java/org/opensearch/index/engine/NRTReplicationReaderManagerTests.java

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -46,43 +46,4 @@ public void testCreateNRTreaderManager() throws IOException {
4646
}
4747
}
4848
}
49-
50-
public void testUpdateSegmentsWhileRefreshing() throws IOException, InterruptedException {
51-
try (final Store store = createStore()) {
52-
store.createEmpty(Version.LATEST);
53-
final DirectoryReader reader = DirectoryReader.open(store.directory());
54-
NRTReplicationReaderManager readerManager = new NRTReplicationReaderManager(
55-
OpenSearchDirectoryReader.wrap(reader, shardId),
56-
(files) -> {},
57-
(files) -> {}
58-
);
59-
60-
final SegmentInfos infos_2 = readerManager.getSegmentInfos().clone();
61-
infos_2.changed();
62-
63-
Thread refreshThread = new Thread(() -> {
64-
try {
65-
readerManager.maybeRefresh();
66-
} catch (IOException e) {
67-
throw new RuntimeException(e);
68-
}
69-
});
70-
Thread updateThread = new Thread(() -> {
71-
try {
72-
readerManager.updateSegments(infos_2);
73-
} catch (IOException e) {
74-
throw new RuntimeException(e);
75-
}
76-
});
77-
refreshThread.start();
78-
updateThread.start();
79-
refreshThread.join();
80-
updateThread.join();
81-
try (final OpenSearchDirectoryReader acquire = readerManager.acquire()) {
82-
final StandardDirectoryReader standardReader = NRTReplicationReaderManager.unwrapStandardReader(acquire);
83-
assertEquals(infos_2.version, standardReader.getSegmentInfos().version);
84-
}
85-
assertEquals(infos_2, readerManager.getSegmentInfos());
86-
}
87-
}
8849
}

0 commit comments

Comments
 (0)