File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
qa/packaging/src/test/java/org/elasticsearch/packaging/util/docker Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -185,10 +185,14 @@ public static void waitForElasticsearchToStart() {
185
185
try {
186
186
// Give the container enough time for security auto-configuration or a chance to crash out
187
187
Thread .sleep (STARTUP_SLEEP_INTERVAL_MILLISECONDS );
188
-
188
+ String detectCommand =
189
+ "for pid in $(ps -eo pid,comm | grep java | awk '\\ ''{print $1}'\\ ''); do cmdline=$(tr \" \\ 0\" \" \" < /proc/$pid/cmdline 2>/dev/null); [[ $cmdline == *org.elasticsearch.bootstrap.Elasticsearch* ]] && echo \" PID $pid: $cmdline\" ; done | wc -l" ;
189
190
// The length of the command exceeds what we can use for COLUMNS so we use a pipe to detect the process we're looking for
190
- psOutput = dockerShell .run ("bash -c 'ps -ax | grep org.elasticsearch.bootstrap.Elasticsearch | grep -v grep | wc -l'" )
191
- .stdout ();
191
+ psOutput = dockerShell .run ("bash -c '" + detectCommand + "'" ).stdout ();
192
+ // System.out.println("psOutput = " + psOutput);
193
+ // psOutput = dockerShell.run(
194
+ // "bash -c 'COLUMNS=4000 ps w | grep org.elasticsearch.bootstrap.Elasticsearch | grep -v grep | wc -l'"
195
+ // ).stdout();
192
196
if (psOutput .contains ("1" )) {
193
197
isElasticsearchRunning = true ;
194
198
break ;
You can’t perform that action at this time.
0 commit comments