@@ -1077,24 +1077,6 @@ public void testDynamicStalenessThresholdUpdate() throws Exception {
1077
1077
1078
1078
// staleness threshold dynamic updates should throw exceptions on invalid input
1079
1079
public void testInvalidStalenessThresholdUpdateThrowsException () throws Exception {
1080
- int cacheCleanIntervalInMillis = 1 ;
1081
- String node = internalCluster ().startNode (
1082
- Settings .builder ()
1083
- .put (IndicesRequestCache .INDICES_REQUEST_CACHE_CLEANUP_STALENESS_THRESHOLD_SETTING_KEY , 0.90 )
1084
- .put (
1085
- IndicesRequestCache .INDICES_REQUEST_CACHE_CLEANUP_INTERVAL_SETTING_KEY ,
1086
- TimeValue .timeValueMillis (cacheCleanIntervalInMillis )
1087
- )
1088
- );
1089
- Client client = client (node );
1090
- String index1 = "index1" ;
1091
- setupIndex (client , index1 );
1092
-
1093
- // create first cache entry in index1
1094
- createCacheEntry (client , index1 , "hello" );
1095
- assertCacheState (client , index1 , 0 , 1 );
1096
- assertTrue (getRequestCacheStats (client , index1 ).getMemorySizeInBytes () > 0 );
1097
-
1098
1080
// Update indices.requests.cache.cleanup.staleness_threshold to "10%" with illegal argument
1099
1081
assertThrows ("Ratio should be in [0-1.0]" , IllegalArgumentException .class , () -> {
1100
1082
ClusterUpdateSettingsRequest updateSettingsRequest = new ClusterUpdateSettingsRequest ();
@@ -1103,15 +1085,6 @@ public void testInvalidStalenessThresholdUpdateThrowsException() throws Exceptio
1103
1085
);
1104
1086
client ().admin ().cluster ().updateSettings (updateSettingsRequest ).actionGet ();
1105
1087
});
1106
-
1107
- // everything else should continue to work fine later on.
1108
- // force refresh so that it creates 1 stale key
1109
- flushAndRefresh (index1 );
1110
- // sleep until cache cleaner would have cleaned up the stale key from index 2
1111
- assertBusy (() -> {
1112
- // cache cleaner should NOT have cleaned from index 1
1113
- assertEquals (0 , getRequestCacheStats (client , index1 ).getMemorySizeInBytes ());
1114
- }, cacheCleanIntervalInMillis * 2 , TimeUnit .MILLISECONDS );
1115
1088
}
1116
1089
1117
1090
// closing the Index after caching will clean up from Indices Request Cache
0 commit comments