Fixes Tests so build passes
This commit is contained in:
parent
a37df9092e
commit
043c8db84d
|
@ -180,7 +180,13 @@ public class ForceMergeAction implements LifecycleAction {
|
|||
r2 -> forceMerge(index, client, listener,
|
||||
// after a successful force-merge, return the index to read-write
|
||||
r3 -> updateBlockWriteSettingToReadWrite(index, client, listener))),
|
||||
r4 -> { if (isReadOnly) updateBlockWriteSettingToReadWrite(index, client, listener); });
|
||||
r4 -> {
|
||||
if (isReadOnly) {
|
||||
updateBlockWriteSettingToReadWrite(index, client, listener);
|
||||
} else {
|
||||
listener.onSuccess(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -296,7 +296,7 @@ public class ForceMergeActionTests extends AbstractSerializingTestCase<ForceMerg
|
|||
}
|
||||
});
|
||||
|
||||
assertEquals(null, actionCompleted.get());
|
||||
assertEquals(true, actionCompleted.get());
|
||||
|
||||
InOrder inOrder = Mockito.inOrder(clusterService, client, adminClient, indicesClient);
|
||||
inOrder.verify(clusterService).state();
|
||||
|
|
|
@ -91,8 +91,7 @@ public class IndexLifecycleInitialisationIT extends ESIntegTestCase {
|
|||
.put(SETTING_NUMBER_OF_REPLICAS, 0).put("index.lifecycle.name", "test").build();
|
||||
Map<String, Phase> phases = new HashMap<>();
|
||||
|
||||
Map<String, LifecycleAction> warmPhaseActions = Collections.singletonMap(ForceMergeAction.NAME,
|
||||
new ForceMergeAction(-1));
|
||||
Map<String, LifecycleAction> warmPhaseActions = Collections.singletonMap(ForceMergeAction.NAME, new ForceMergeAction(10000));
|
||||
phases.put("warm", new Phase("warm", TimeValue.timeValueSeconds(2), warmPhaseActions));
|
||||
|
||||
Map<String, LifecycleAction> deletePhaseActions = Collections.singletonMap(DeleteAction.NAME, new DeleteAction());
|
||||
|
@ -124,8 +123,7 @@ public class IndexLifecycleInitialisationIT extends ESIntegTestCase {
|
|||
public void testMasterDedicatedDataDedicated() throws Exception {
|
||||
// start master node
|
||||
logger.info("Starting sever1");
|
||||
final String server_1 = internalCluster().startMasterOnlyNode();
|
||||
final String node1 = getLocalNodeId(server_1);
|
||||
internalCluster().startMasterOnlyNode();
|
||||
// start data node
|
||||
logger.info("Starting sever1");
|
||||
final String server_2 = internalCluster().startDataOnlyNode();
|
||||
|
@ -171,7 +169,7 @@ public class IndexLifecycleInitialisationIT extends ESIntegTestCase {
|
|||
|
||||
logger.info("Starting server2");
|
||||
// start another server
|
||||
String server_2 = internalCluster().startNode();
|
||||
internalCluster().startNode();
|
||||
|
||||
// first wait for 2 nodes in the cluster
|
||||
logger.info("Waiting for replicas to be assigned");
|
||||
|
|
|
@ -223,7 +223,7 @@ public class IndexLifecycleServiceTests extends ESTestCase {
|
|||
when(clusterService.state()).thenReturn(currentState);
|
||||
|
||||
doAnswer(invocationOnMock -> {
|
||||
ActionListener<UpdateSettingsResponse> listener = (ActionListener) invocationOnMock.getArguments()[1];
|
||||
ActionListener<UpdateSettingsResponse> listener = (ActionListener<UpdateSettingsResponse>) invocationOnMock.getArguments()[1];
|
||||
listener.onResponse(UpdateSettingsTestHelper.createMockResponse(true));
|
||||
return null;
|
||||
|
||||
|
|
|
@ -18,7 +18,9 @@ setup:
|
|||
"warm": {
|
||||
"after": "10s",
|
||||
"actions": {
|
||||
"forcemerge": {}
|
||||
"forcemerge": {
|
||||
"max_num_segments": 10000
|
||||
}
|
||||
}
|
||||
},
|
||||
"delete": {
|
||||
|
|
Loading…
Reference in New Issue