File tree 2 files changed +12
-1
lines changed
buildSrc/src/main/java/org/elasticsearch/gradle/testclusters 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -660,7 +660,8 @@ private Map<String, String> getESEnvironment() {
660
660
})
661
661
.collect (Collectors .joining (" " ));
662
662
}
663
- defaultEnv .put ("ES_JAVA_OPTS" , "-Xms512m -Xmx512m -ea -esa " +
663
+ String heapSize = System .getProperty ("tests.heap.size" , "512m" );
664
+ defaultEnv .put ("ES_JAVA_OPTS" , "-Xms" + heapSize + " -Xmx" + heapSize + " -ea -esa " +
664
665
systemPropertiesString + " " +
665
666
jvmArgsString + " " +
666
667
// Support passing in additional JVM arguments
Original file line number Diff line number Diff line change 10
10
import java .io .IOException ;
11
11
import java .nio .file .Files ;
12
12
import java .util .HashSet ;
13
+ import java .util .Map ;
13
14
import java .util .Set ;
15
+ import java .util .stream .Collectors ;
14
16
15
17
public class RunTask extends DefaultTestClustersTask {
16
18
17
19
private static final Logger logger = Logging .getLogger (RunTask .class );
20
+ public static final String CUSTOM_SETTINGS_PREFIX = "tests.es." ;
18
21
19
22
private Boolean debug = false ;
20
23
@@ -36,12 +39,19 @@ public void beforeStart() {
36
39
int debugPort = 8000 ;
37
40
int httpPort = 9200 ;
38
41
int transportPort = 9300 ;
42
+ Map <String , String > additionalSettings = System .getProperties ().entrySet ().stream ()
43
+ .filter (entry -> entry .getKey ().toString ().startsWith (CUSTOM_SETTINGS_PREFIX ))
44
+ .collect (Collectors .toMap (
45
+ entry -> entry .getKey ().toString ().substring (CUSTOM_SETTINGS_PREFIX .length ()),
46
+ entry -> entry .getValue ().toString ()
47
+ ));
39
48
for (ElasticsearchCluster cluster : getClusters ()) {
40
49
cluster .getFirstNode ().setHttpPort (String .valueOf (httpPort ));
41
50
httpPort ++;
42
51
cluster .getFirstNode ().setTransportPort (String .valueOf (transportPort ));
43
52
transportPort ++;
44
53
for (ElasticsearchNode node : cluster .getNodes ()) {
54
+ additionalSettings .forEach (node ::setting );
45
55
if (debug ) {
46
56
logger .lifecycle (
47
57
"Running elasticsearch in debug mode, {} suspending until connected on debugPort {}" ,
You can’t perform that action at this time.
0 commit comments