@@ -1077,24 +1077,6 @@ public void testDynamicStalenessThresholdUpdate() throws Exception {
10771077
10781078 // staleness threshold dynamic updates should throw exceptions on invalid input
10791079 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-
10981080 // Update indices.requests.cache.cleanup.staleness_threshold to "10%" with illegal argument
10991081 assertThrows ("Ratio should be in [0-1.0]" , IllegalArgumentException .class , () -> {
11001082 ClusterUpdateSettingsRequest updateSettingsRequest = new ClusterUpdateSettingsRequest ();
@@ -1103,15 +1085,6 @@ public void testInvalidStalenessThresholdUpdateThrowsException() throws Exceptio
11031085 );
11041086 client ().admin ().cluster ().updateSettings (updateSettingsRequest ).actionGet ();
11051087 });
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 );
11151088 }
11161089
11171090 // closing the Index after caching will clean up from Indices Request Cache
0 commit comments