Commit 60824c8 1 parent 2f021dd commit 60824c8 Copy full SHA for 60824c8
File tree 2 files changed +4
-13
lines changed
src/test/java/org/opensearch/knn
quantization/models/quantizationState
2 files changed +4
-13
lines changed Original file line number Diff line number Diff line change 12
12
package org .opensearch .knn .index .memory ;
13
13
14
14
import com .google .common .cache .CacheStats ;
15
- import org .junit .After ;
16
15
import org .junit .Before ;
17
16
import org .opensearch .action .admin .cluster .settings .ClusterUpdateSettingsRequest ;
18
17
import org .opensearch .common .settings .Settings ;
@@ -41,18 +40,11 @@ public class NativeMemoryCacheManagerTests extends OpenSearchSingleNodeTestCase
41
40
private ThreadPool threadPool ;
42
41
43
42
@ Before
44
- public void setUp () throws Exception {
45
- super .setUp ();
43
+ public void setThreadPool () {
46
44
threadPool = new ThreadPool (Settings .builder ().put ("node.name" , "NativeMemoryCacheManagerTests" ).build ());
47
45
NativeMemoryCacheManager .setThreadPool (threadPool );
48
46
}
49
47
50
- @ After
51
- public void shutdown () throws Exception {
52
- super .tearDown ();
53
- terminate (threadPool );
54
- }
55
-
56
48
@ Override
57
49
public void tearDown () throws Exception {
58
50
// Clear out persistent metadata
@@ -61,6 +53,7 @@ public void tearDown() throws Exception {
61
53
clusterUpdateSettingsRequest .persistentSettings (circuitBreakerSettings );
62
54
client ().admin ().cluster ().updateSettings (clusterUpdateSettingsRequest ).get ();
63
55
NativeMemoryCacheManager .getInstance ().close ();
56
+ terminate (threadPool );
64
57
super .tearDown ();
65
58
}
66
59
Original file line number Diff line number Diff line change @@ -36,15 +36,13 @@ public class QuantizationStateCacheTests extends KNNTestCase {
36
36
private ThreadPool threadPool ;
37
37
38
38
@ Before
39
- public void setUp () throws Exception {
40
- super .setUp ();
39
+ public void setThreadPool () {
41
40
threadPool = new ThreadPool (Settings .builder ().put ("node.name" , "QuantizationStateCacheTests" ).build ());
42
41
QuantizationStateCache .setThreadPool (threadPool );
43
42
}
44
43
45
44
@ After
46
- public void shutdown () throws Exception {
47
- super .tearDown ();
45
+ public void terminateThreadPool () {
48
46
terminate (threadPool );
49
47
}
50
48
You can’t perform that action at this time.
0 commit comments