Skip to content

Commit ea83a23

Browse files
[9.0] Unmute docker tests, add more logging and increase startup timeout (#131203) (#131293)
* Unmute docker tests, add more logging and increase startup timeout (#131203) Unmuting 33 DockerTests with added additional logging on failures. Also, bumping docker startup timeout to account for slow security auto-configuration, and additionally moving CA certificates inside the retry while loop. Resolves #129808 Resolves #123437 Resolves #120911 Resolves #120914 Resolves #120910 Resolves #120918 Resolves #120925 Resolves #124990 Resolves #116636 Resolves #125680 Resolves #116147 Resolves #126232 Resolves #126145 Resolves #116866 Resolves #126936 Resolves #127081 Resolves #127158 Resolves #127138 Resolves #128018 Resolves #128031 Resolves #128110 Resolves #128006 Resolves #128174 Resolves #128144 Resolves #128165 Resolves #128075 Resolves #128117 Resolves #128121 Resolves #128115 Resolves #128230 Resolves #128120 Resolves #128996 Resolves #128867 (cherry picked from commit 4806156) # Conflicts: # muted-tests.yml * call dumpDebug
1 parent 5e8bab5 commit ea83a23

File tree

4 files changed

+23
-50
lines changed

4 files changed

+23
-50
lines changed

muted-tests.yml

Lines changed: 1 addition & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -161,24 +161,9 @@ tests:
161161
- class: org.elasticsearch.xpack.security.authc.service.ServiceAccountIT
162162
method: testAuthenticateShouldNotFallThroughInCaseOfFailure
163163
issue: https://github.com/elastic/elasticsearch/issues/120902
164-
- class: org.elasticsearch.packaging.test.DockerTests
165-
method: test050BasicApiTests
166-
issue: https://github.com/elastic/elasticsearch/issues/120911
167-
- class: org.elasticsearch.packaging.test.DockerTests
168-
method: test140CgroupOsStatsAreAvailable
169-
issue: https://github.com/elastic/elasticsearch/issues/120914
170164
- class: org.elasticsearch.xpack.security.FileSettingsRoleMappingsRestartIT
171165
method: testReservedStatePersistsOnRestart
172166
issue: https://github.com/elastic/elasticsearch/issues/120923
173-
- class: org.elasticsearch.packaging.test.DockerTests
174-
method: test070BindMountCustomPathConfAndJvmOptions
175-
issue: https://github.com/elastic/elasticsearch/issues/120910
176-
- class: org.elasticsearch.packaging.test.DockerTests
177-
method: test071BindMountCustomPathWithDifferentUID
178-
issue: https://github.com/elastic/elasticsearch/issues/120918
179-
- class: org.elasticsearch.packaging.test.DockerTests
180-
method: test171AdditionalCliOptionsAreForwarded
181-
issue: https://github.com/elastic/elasticsearch/issues/120925
182167
- class: org.elasticsearch.backwards.MixedClusterClientYamlTestSuiteIT
183168
method: test {p0=nodes.stats/11_indices_metrics/indices mappings exact count test for indices level}
184169
issue: https://github.com/elastic/elasticsearch/issues/120950
@@ -208,9 +193,6 @@ tests:
208193
- class: org.elasticsearch.analysis.common.CommonAnalysisClientYamlTestSuiteIT
209194
method: test {yaml=analysis-common/40_token_filters/stemmer_override file access}
210195
issue: https://github.com/elastic/elasticsearch/issues/121625
211-
- class: org.elasticsearch.packaging.test.DockerTests
212-
method: test151MachineDependentHeapWithSizeOverride
213-
issue: https://github.com/elastic/elasticsearch/issues/123437
214196
- class: org.elasticsearch.smoketest.DocsClientYamlTestSuiteIT
215197
method: test {yaml=reference/cat/nodes/line_361}
216198
issue: https://github.com/elastic/elasticsearch/issues/124103
@@ -244,39 +226,15 @@ tests:
244226
- class: org.elasticsearch.packaging.test.EnrollmentProcessTests
245227
method: test20DockerAutoFormCluster
246228
issue: https://github.com/elastic/elasticsearch/issues/128113
247-
- class: org.elasticsearch.packaging.test.DockerTests
248-
method: test011SecurityEnabledStatus
249-
issue: https://github.com/elastic/elasticsearch/issues/124990
250229
- class: org.elasticsearch.packaging.test.TemporaryDirectoryConfigTests
251230
method: test21AcceptsCustomPathInDocker
252231
issue: https://github.com/elastic/elasticsearch/issues/128114
253-
- class: org.elasticsearch.packaging.test.DockerTests
254-
method: test130JavaHasCorrectOwnership
255-
issue: https://github.com/elastic/elasticsearch/issues/128174
256-
- class: org.elasticsearch.packaging.test.DockerTests
257-
method: test024InstallPluginFromArchiveUsingConfigFile
258-
issue: https://github.com/elastic/elasticsearch/issues/126936
259-
- class: org.elasticsearch.packaging.test.DockerTests
260-
method: test120DockerLogsIncludeElasticsearchLogs
261-
issue: https://github.com/elastic/elasticsearch/issues/128117
262-
- class: org.elasticsearch.packaging.test.DockerTests
263-
method: test072RunEsAsDifferentUserAndGroup
264-
issue: https://github.com/elastic/elasticsearch/issues/128031
265-
- class: org.elasticsearch.packaging.test.DockerTests
266-
method: test010Install
267-
issue: https://github.com/elastic/elasticsearch/issues/125680
268-
- class: org.elasticsearch.packaging.test.DockerTests
269-
method: test600Interrupt
270-
issue: https://github.com/elastic/elasticsearch/issues/128144
271232
- class: org.elasticsearch.action.admin.cluster.node.tasks.CancellableTasksIT
272233
method: testChildrenTasksCancelledOnTimeout
273234
issue: https://github.com/elastic/elasticsearch/issues/123568
274235
- class: org.elasticsearch.index.engine.ThreadPoolMergeExecutorServiceDiskSpaceTests
275236
method: testUnavailableBudgetBlocksNewMergeTasksFromStartingExecution
276237
issue: https://github.com/elastic/elasticsearch/issues/130205
277-
- class: org.elasticsearch.packaging.test.DockerTests
278-
method: test080ConfigurePasswordThroughEnvironmentVariableFile
279-
issue: https://github.com/elastic/elasticsearch/issues/128075
280238

281239
# Examples:
282240
#
@@ -315,4 +273,4 @@ tests:
315273
# issue: "https://github.com/elastic/elasticsearch/..."
316274
# - class: "org.elasticsearch.xpack.esql.**"
317275
# method: "test {union_types.MultiIndexIpStringStatsInline *}"
318-
# issue: "https://github.com/elastic/elasticsearch/..."
276+
# issue: "https://github.com/elastic/elasticsearch/..."

qa/packaging/src/test/java/org/elasticsearch/packaging/test/PackagingTestCase.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,10 @@ public abstract class PackagingTestCase extends Assert {
145145
@Override
146146
protected void failed(Throwable e, Description description) {
147147
failed = true;
148+
if (installation != null && installation.distribution.isDocker()) {
149+
logger.warn("Test {} failed. Printing logs for failed test...", description.getMethodName());
150+
dumpDebug();
151+
}
148152
}
149153
};
150154

qa/packaging/src/test/java/org/elasticsearch/packaging/util/ServerUtils.java

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,19 @@ private static HttpResponse execute(Request request, String username, String pas
150150
executor.auth(username, password);
151151
executor.authPreemptive(new HttpHost("localhost", 9200));
152152
}
153-
return executor.execute(request).returnResponse();
153+
try {
154+
return executor.execute(request).returnResponse();
155+
} catch (Exception e) {
156+
logger.warn(
157+
"Failed to execute request [{}] with username/password [{}/{}] and caCert [{}]",
158+
request.toString(),
159+
username,
160+
password,
161+
caCert,
162+
e
163+
);
164+
throw e;
165+
}
154166
}
155167

156168
// polls every two seconds for Elasticsearch to be running on 9200
@@ -238,14 +250,13 @@ public static void waitForElasticsearch(
238250
long timeElapsed = 0;
239251
boolean started = false;
240252
Throwable thrownException = null;
241-
if (caCert == null) {
242-
caCert = getCaCert(installation);
243-
}
244253

245254
while (started == false && timeElapsed < waitTime) {
246255
if (System.currentTimeMillis() - lastRequest > requestInterval) {
256+
if (caCert == null) {
257+
caCert = getCaCert(installation);
258+
}
247259
try {
248-
249260
final HttpResponse response = execute(
250261
Request.Get((caCert != null ? "https" : "http") + "://localhost:9200/_cluster/health")
251262
.connectTimeout((int) timeoutLength)
@@ -276,7 +287,7 @@ public static void waitForElasticsearch(
276287
}
277288
started = true;
278289

279-
} catch (IOException e) {
290+
} catch (Exception e) {
280291
if (thrownException == null) {
281292
thrownException = e;
282293
} else {

qa/packaging/src/test/java/org/elasticsearch/packaging/util/docker/Docker.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public class Docker {
7373
public static final Shell sh = new Shell();
7474
public static final DockerShell dockerShell = new DockerShell();
7575
public static final int STARTUP_SLEEP_INTERVAL_MILLISECONDS = 1000;
76-
public static final int STARTUP_ATTEMPTS_MAX = 30;
76+
public static final int STARTUP_ATTEMPTS_MAX = 45;
7777

7878
/**
7979
* The length of the command exceeds what we can use for COLUMNS so we use

0 commit comments

Comments
 (0)