Skip to content

Commit 6af688e

Browse files
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
1 parent ae0cc0f commit 6af688e

File tree

4 files changed

+22
-103
lines changed

4 files changed

+22
-103
lines changed

muted-tests.yml

Lines changed: 0 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -140,21 +140,6 @@ tests:
140140
- class: org.elasticsearch.xpack.security.authc.service.ServiceAccountIT
141141
method: testAuthenticateShouldNotFallThroughInCaseOfFailure
142142
issue: https://github.com/elastic/elasticsearch/issues/120902
143-
- class: org.elasticsearch.packaging.test.DockerTests
144-
method: test050BasicApiTests
145-
issue: https://github.com/elastic/elasticsearch/issues/120911
146-
- class: org.elasticsearch.packaging.test.DockerTests
147-
method: test140CgroupOsStatsAreAvailable
148-
issue: https://github.com/elastic/elasticsearch/issues/120914
149-
- class: org.elasticsearch.packaging.test.DockerTests
150-
method: test070BindMountCustomPathConfAndJvmOptions
151-
issue: https://github.com/elastic/elasticsearch/issues/120910
152-
- class: org.elasticsearch.packaging.test.DockerTests
153-
method: test071BindMountCustomPathWithDifferentUID
154-
issue: https://github.com/elastic/elasticsearch/issues/120918
155-
- class: org.elasticsearch.packaging.test.DockerTests
156-
method: test171AdditionalCliOptionsAreForwarded
157-
issue: https://github.com/elastic/elasticsearch/issues/120925
158143
- class: org.elasticsearch.backwards.MixedClusterClientYamlTestSuiteIT
159144
method: test {p0=nodes.stats/11_indices_metrics/indices mappings exact count test for indices level}
160145
issue: https://github.com/elastic/elasticsearch/issues/120950
@@ -174,9 +159,6 @@ tests:
174159
- class: org.elasticsearch.xpack.ilm.TimeSeriesLifecycleActionsIT
175160
method: testHistoryIsWrittenWithFailure
176161
issue: https://github.com/elastic/elasticsearch/issues/123203
177-
- class: org.elasticsearch.packaging.test.DockerTests
178-
method: test151MachineDependentHeapWithSizeOverride
179-
issue: https://github.com/elastic/elasticsearch/issues/123437
180162
- class: org.elasticsearch.action.admin.cluster.node.tasks.CancellableTasksIT
181163
method: testChildrenTasksCancelledOnTimeout
182164
issue: https://github.com/elastic/elasticsearch/issues/123568
@@ -219,12 +201,6 @@ tests:
219201
- class: org.elasticsearch.packaging.test.BootstrapCheckTests
220202
method: test10Install
221203
issue: https://github.com/elastic/elasticsearch/issues/124957
222-
- class: org.elasticsearch.packaging.test.DockerTests
223-
method: test011SecurityEnabledStatus
224-
issue: https://github.com/elastic/elasticsearch/issues/124990
225-
- class: org.elasticsearch.packaging.test.DockerTests
226-
method: test012SecurityCanBeDisabled
227-
issue: https://github.com/elastic/elasticsearch/issues/116636
228204
- class: org.elasticsearch.index.shard.StoreRecoveryTests
229205
method: testAddIndices
230206
issue: https://github.com/elastic/elasticsearch/issues/124104
@@ -237,9 +213,6 @@ tests:
237213
- class: org.elasticsearch.smoketest.MlWithSecurityIT
238214
method: test {yaml=ml/data_frame_analytics_cat_apis/Test cat data frame analytics single job with header}
239215
issue: https://github.com/elastic/elasticsearch/issues/125642
240-
- class: org.elasticsearch.packaging.test.DockerTests
241-
method: test010Install
242-
issue: https://github.com/elastic/elasticsearch/issues/125680
243216
- class: org.elasticsearch.xpack.test.rest.XPackRestIT
244217
method: test {p0=transform/transforms_start_stop/Test schedule_now on an already started transform}
245218
issue: https://github.com/elastic/elasticsearch/issues/120720
@@ -255,9 +228,6 @@ tests:
255228
- class: org.elasticsearch.xpack.test.rest.XPackRestIT
256229
method: test {p0=transform/transforms_stats/Test get transform stats with timeout}
257230
issue: https://github.com/elastic/elasticsearch/issues/125975
258-
- class: org.elasticsearch.packaging.test.DockerTests
259-
method: test021InstallPlugin
260-
issue: https://github.com/elastic/elasticsearch/issues/116147
261231
- class: org.elasticsearch.action.RejectionActionIT
262232
method: testSimulatedSearchRejectionLoad
263233
issue: https://github.com/elastic/elasticsearch/issues/125901
@@ -267,9 +237,6 @@ tests:
267237
- class: org.elasticsearch.search.basic.SearchWithRandomDisconnectsIT
268238
method: testSearchWithRandomDisconnects
269239
issue: https://github.com/elastic/elasticsearch/issues/122707
270-
- class: org.elasticsearch.packaging.test.DockerTests
271-
method: test020PluginsListWithNoPlugins
272-
issue: https://github.com/elastic/elasticsearch/issues/126232
273240
- class: org.elasticsearch.xpack.test.rest.XPackRestIT
274241
method: test {p0=transform/transforms_reset/Test force reseting a running transform}
275242
issue: https://github.com/elastic/elasticsearch/issues/126240
@@ -279,15 +246,9 @@ tests:
279246
- class: org.elasticsearch.xpack.test.rest.XPackRestIT
280247
method: test {p0=ml/start_data_frame_analytics/Test start classification analysis when the dependent variable cardinality is too low}
281248
issue: https://github.com/elastic/elasticsearch/issues/126299
282-
- class: org.elasticsearch.packaging.test.DockerTests
283-
method: test023InstallPluginUsingConfigFile
284-
issue: https://github.com/elastic/elasticsearch/issues/126145
285249
- class: org.elasticsearch.smoketest.MlWithSecurityIT
286250
method: test {yaml=ml/start_data_frame_analytics/Test start classification analysis when the dependent variable cardinality is too low}
287251
issue: https://github.com/elastic/elasticsearch/issues/123200
288-
- class: org.elasticsearch.packaging.test.DockerTests
289-
method: test022InstallPluginsFromLocalArchive
290-
issue: https://github.com/elastic/elasticsearch/issues/116866
291252
- class: org.elasticsearch.smoketest.MlWithSecurityIT
292253
method: test {yaml=ml/trained_model_cat_apis/Test cat trained models}
293254
issue: https://github.com/elastic/elasticsearch/issues/125750
@@ -330,15 +291,6 @@ tests:
330291
- class: org.elasticsearch.cli.keystore.AddStringKeyStoreCommandTests
331292
method: testStdinWithMultipleValues
332293
issue: https://github.com/elastic/elasticsearch/issues/126882
333-
- class: org.elasticsearch.packaging.test.DockerTests
334-
method: test024InstallPluginFromArchiveUsingConfigFile
335-
issue: https://github.com/elastic/elasticsearch/issues/126936
336-
- class: org.elasticsearch.packaging.test.DockerTests
337-
method: test026InstallBundledRepositoryPlugins
338-
issue: https://github.com/elastic/elasticsearch/issues/127081
339-
- class: org.elasticsearch.packaging.test.DockerTests
340-
method: test026InstallBundledRepositoryPluginsViaConfigFile
341-
issue: https://github.com/elastic/elasticsearch/issues/127158
342294
- class: org.elasticsearch.xpack.remotecluster.CrossClusterEsqlRCS2EnrichUnavailableRemotesIT
343295
method: testEsqlEnrichWithSkipUnavailable
344296
issue: https://github.com/elastic/elasticsearch/issues/127368
@@ -357,48 +309,18 @@ tests:
357309
- class: org.elasticsearch.backwards.MixedClusterClientYamlTestSuiteIT
358310
method: test {p0=search/350_point_in_time/point-in-time with index filter}
359311
issue: https://github.com/elastic/elasticsearch/issues/127741
360-
- class: org.elasticsearch.packaging.test.DockerTests
361-
method: test025SyncPluginsUsingProxy
362-
issue: https://github.com/elastic/elasticsearch/issues/127138
363312
- class: org.elasticsearch.xpack.esql.action.CrossClusterQueryWithPartialResultsIT
364313
method: testOneRemoteClusterPartial
365314
issue: https://github.com/elastic/elasticsearch/issues/124055
366315
- class: org.elasticsearch.xpack.esql.qa.multi_node.EsqlSpecIT
367316
method: test {lookup-join.MvJoinKeyOnTheLookupIndex ASYNC}
368317
issue: https://github.com/elastic/elasticsearch/issues/128030
369-
- class: org.elasticsearch.packaging.test.DockerTests
370-
method: test042KeystorePermissionsAreCorrect
371-
issue: https://github.com/elastic/elasticsearch/issues/128018
372-
- class: org.elasticsearch.packaging.test.DockerTests
373-
method: test072RunEsAsDifferentUserAndGroup
374-
issue: https://github.com/elastic/elasticsearch/issues/128031
375-
- class: org.elasticsearch.packaging.test.DockerTests
376-
method: test122CanUseDockerLoggingConfig
377-
issue: https://github.com/elastic/elasticsearch/issues/128110
378-
- class: org.elasticsearch.packaging.test.DockerTests
379-
method: test041AmazonCaCertsAreInTheKeystore
380-
issue: https://github.com/elastic/elasticsearch/issues/128006
381-
- class: org.elasticsearch.packaging.test.DockerTests
382-
method: test130JavaHasCorrectOwnership
383-
issue: https://github.com/elastic/elasticsearch/issues/128174
384-
- class: org.elasticsearch.packaging.test.DockerTests
385-
method: test600Interrupt
386-
issue: https://github.com/elastic/elasticsearch/issues/128144
387318
- class: org.elasticsearch.packaging.test.EnrollmentProcessTests
388319
method: test20DockerAutoFormCluster
389320
issue: https://github.com/elastic/elasticsearch/issues/128113
390-
- class: org.elasticsearch.packaging.test.DockerTests
391-
method: test121CanUseStackLoggingConfig
392-
issue: https://github.com/elastic/elasticsearch/issues/128165
393-
- class: org.elasticsearch.packaging.test.DockerTests
394-
method: test080ConfigurePasswordThroughEnvironmentVariableFile
395-
issue: https://github.com/elastic/elasticsearch/issues/128075
396321
- class: org.elasticsearch.ingest.geoip.GeoIpDownloaderCliIT
397322
method: testInvalidTimestamp
398323
issue: https://github.com/elastic/elasticsearch/issues/128284
399-
- class: org.elasticsearch.packaging.test.DockerTests
400-
method: test120DockerLogsIncludeElasticsearchLogs
401-
issue: https://github.com/elastic/elasticsearch/issues/128117
402324
- class: org.elasticsearch.packaging.test.TemporaryDirectoryConfigTests
403325
method: test21AcceptsCustomPathInDocker
404326
issue: https://github.com/elastic/elasticsearch/issues/128114
@@ -417,30 +339,12 @@ tests:
417339
- class: org.elasticsearch.xpack.esql.action.CrossClusterQueryWithPartialResultsIT
418340
method: testFailToStartRequestOnRemoteCluster
419341
issue: https://github.com/elastic/elasticsearch/issues/128545
420-
- class: org.elasticsearch.packaging.test.DockerTests
421-
method: test124CanRestartContainerWithStackLoggingConfig
422-
issue: https://github.com/elastic/elasticsearch/issues/128121
423-
- class: org.elasticsearch.packaging.test.DockerTests
424-
method: test085EnvironmentVariablesAreRespectedUnderDockerExec
425-
issue: https://github.com/elastic/elasticsearch/issues/128115
426342
- class: org.elasticsearch.compute.operator.LimitOperatorTests
427343
method: testEarlyTermination
428344
issue: https://github.com/elastic/elasticsearch/issues/128721
429-
- class: org.elasticsearch.packaging.test.DockerTests
430-
method: test040JavaUsesTheOsProvidedKeystore
431-
issue: https://github.com/elastic/elasticsearch/issues/128230
432-
- class: org.elasticsearch.packaging.test.DockerTests
433-
method: test150MachineDependentHeap
434-
issue: https://github.com/elastic/elasticsearch/issues/128120
435345
- class: org.elasticsearch.xpack.inference.InferenceGetServicesIT
436346
method: testGetServicesWithCompletionTaskType
437347
issue: https://github.com/elastic/elasticsearch/issues/128952
438-
- class: org.elasticsearch.packaging.test.DockerTests
439-
method: test073RunEsAsDifferentUserAndGroupWithoutBindMounting
440-
issue: https://github.com/elastic/elasticsearch/issues/128996
441-
- class: org.elasticsearch.packaging.test.DockerTests
442-
method: test081SymlinksAreFollowedWithEnvironmentVariableFiles
443-
issue: https://github.com/elastic/elasticsearch/issues/128867
444348
- class: org.elasticsearch.xpack.esql.qa.single_node.GenerativeForkIT
445349
method: test {lookup-join.EnrichLookupStatsBug ASYNC}
446350
issue: https://github.com/elastic/elasticsearch/issues/129228

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+
FileUtils.logAllLogs(installation.logs, logger);
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)