@@ -110,64 +110,6 @@ public void testAutoQueueSizingDown() throws Exception {
110
110
executor .awaitTermination (10 , TimeUnit .SECONDS );
111
111
}
112
112
113
- public void testAutoQueueSizingWithMin () throws Exception {
114
- ThreadContext context = new ThreadContext (Settings .EMPTY );
115
- ResizableBlockingQueue <Runnable > queue =
116
- new ResizableBlockingQueue <>(ConcurrentCollections .<Runnable >newBlockingQueue (),
117
- 5000 );
118
-
119
- int threads = randomIntBetween (1 , 5 );
120
- int measureWindow = randomIntBetween (10 , 100 );
121
- int min = randomIntBetween (4981 , 4999 );
122
- logger .info ("--> auto-queue with a measurement window of {} tasks" , measureWindow );
123
- QueueResizingEsThreadPoolExecutor executor =
124
- new QueueResizingEsThreadPoolExecutor (
125
- "test-threadpool" , threads , threads , 1000 ,
126
- TimeUnit .MILLISECONDS , queue , min , 100000 , slowWrapper (), measureWindow , TimeValue .timeValueMillis (1 ),
127
- EsExecutors .daemonThreadFactory ("queuetest" ), new EsAbortPolicy (), context );
128
- executor .prestartAllCoreThreads ();
129
- logger .info ("--> executor: {}" , executor );
130
-
131
- // Execute a task multiple times that takes 1m
132
- executeTask (executor , (measureWindow * 5 ));
133
-
134
- // The queue capacity should decrease, but no lower than the minimum
135
- assertBusy (() -> {
136
- assertThat (queue .capacity (), equalTo (min ));
137
- });
138
- executor .shutdown ();
139
- executor .awaitTermination (10 , TimeUnit .SECONDS );
140
- }
141
-
142
- public void testAutoQueueSizingWithMax () throws Exception {
143
- ThreadContext context = new ThreadContext (Settings .EMPTY );
144
- ResizableBlockingQueue <Runnable > queue =
145
- new ResizableBlockingQueue <>(ConcurrentCollections .<Runnable >newBlockingQueue (),
146
- 5000 );
147
-
148
- int threads = randomIntBetween (1 , 5 );
149
- int measureWindow = randomIntBetween (10 , 100 );
150
- int max = randomIntBetween (5010 , 5024 );
151
- logger .info ("--> auto-queue with a measurement window of {} tasks" , measureWindow );
152
- QueueResizingEsThreadPoolExecutor executor =
153
- new QueueResizingEsThreadPoolExecutor (
154
- "test-threadpool" , threads , threads , 1000 ,
155
- TimeUnit .MILLISECONDS , queue , 10 , max , fastWrapper (), measureWindow , TimeValue .timeValueMillis (1 ),
156
- EsExecutors .daemonThreadFactory ("queuetest" ), new EsAbortPolicy (), context );
157
- executor .prestartAllCoreThreads ();
158
- logger .info ("--> executor: {}" , executor );
159
-
160
- // Execute a task multiple times that takes 1ms
161
- executeTask (executor , measureWindow * 3 );
162
-
163
- // The queue capacity should increase, but no higher than the maximum
164
- assertBusy (() -> {
165
- assertThat (queue .capacity (), equalTo (max ));
166
- });
167
- executor .shutdown ();
168
- executor .awaitTermination (10 , TimeUnit .SECONDS );
169
- }
170
-
171
113
public void testExecutionEWMACalculation () throws Exception {
172
114
ThreadContext context = new ThreadContext (Settings .EMPTY );
173
115
ResizableBlockingQueue <Runnable > queue =
0 commit comments