Skip to content

Commit c7ee374

Browse files
committed
fix flaky test
Signed-off-by: Yupeng Fu <[email protected]>
1 parent da32ad0 commit c7ee374

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,10 @@ public void testRecovery() throws IOException {
131131
}
132132

133133
public void testPushAPIFailures() {
134-
assertThrows(IngestionEngineException.class, () -> ingestionEngine.index(Mockito.any(Engine.Index.class)));
135-
assertThrows(IngestionEngineException.class, () -> ingestionEngine.delete(Mockito.any(Engine.Delete.class)));
134+
Engine.Index indexMock = Mockito.mock(Engine.Index.class);
135+
assertThrows(IngestionEngineException.class, () -> ingestionEngine.index(indexMock));
136+
Engine.Delete deleteMock = Mockito.mock(Engine.Delete.class);
137+
assertThrows(IngestionEngineException.class, () -> ingestionEngine.delete(deleteMock));
136138
}
137139

138140
public void testCreationFailure() throws IOException {

0 commit comments

Comments
 (0)