Skip to content

Commit 4806156

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
1 parent f1ddd4c commit 4806156

File tree

4 files changed

+22
-106
lines changed

4 files changed

+22
-106
lines changed

muted-tests.yml

Lines changed: 0 additions & 99 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
@@ -171,9 +156,6 @@ tests:
171156
- class: org.elasticsearch.blocks.SimpleBlocksIT
172157
method: testConcurrentAddBlock
173158
issue: https://github.com/elastic/elasticsearch/issues/122324
174-
- class: org.elasticsearch.packaging.test.DockerTests
175-
method: test151MachineDependentHeapWithSizeOverride
176-
issue: https://github.com/elastic/elasticsearch/issues/123437
177159
- class: org.elasticsearch.action.admin.cluster.node.tasks.CancellableTasksIT
178160
method: testChildrenTasksCancelledOnTimeout
179161
issue: https://github.com/elastic/elasticsearch/issues/123568
@@ -207,12 +189,6 @@ tests:
207189
- class: org.elasticsearch.packaging.test.BootstrapCheckTests
208190
method: test10Install
209191
issue: https://github.com/elastic/elasticsearch/issues/124957
210-
- class: org.elasticsearch.packaging.test.DockerTests
211-
method: test011SecurityEnabledStatus
212-
issue: https://github.com/elastic/elasticsearch/issues/124990
213-
- class: org.elasticsearch.packaging.test.DockerTests
214-
method: test012SecurityCanBeDisabled
215-
issue: https://github.com/elastic/elasticsearch/issues/116636
216192
- class: org.elasticsearch.smoketest.MlWithSecurityIT
217193
method: test {yaml=ml/data_frame_analytics_crud/Test get stats on newly created config}
218194
issue: https://github.com/elastic/elasticsearch/issues/121726
@@ -222,9 +198,6 @@ tests:
222198
- class: org.elasticsearch.smoketest.MlWithSecurityIT
223199
method: test {yaml=ml/data_frame_analytics_cat_apis/Test cat data frame analytics single job with header}
224200
issue: https://github.com/elastic/elasticsearch/issues/125642
225-
- class: org.elasticsearch.packaging.test.DockerTests
226-
method: test010Install
227-
issue: https://github.com/elastic/elasticsearch/issues/125680
228201
- class: org.elasticsearch.xpack.test.rest.XPackRestIT
229202
method: test {p0=transform/transforms_start_stop/Test schedule_now on an already started transform}
230203
issue: https://github.com/elastic/elasticsearch/issues/120720
@@ -240,9 +213,6 @@ tests:
240213
- class: org.elasticsearch.xpack.test.rest.XPackRestIT
241214
method: test {p0=transform/transforms_stats/Test get transform stats with timeout}
242215
issue: https://github.com/elastic/elasticsearch/issues/125975
243-
- class: org.elasticsearch.packaging.test.DockerTests
244-
method: test021InstallPlugin
245-
issue: https://github.com/elastic/elasticsearch/issues/116147
246216
- class: org.elasticsearch.action.RejectionActionIT
247217
method: testSimulatedSearchRejectionLoad
248218
issue: https://github.com/elastic/elasticsearch/issues/125901
@@ -252,9 +222,6 @@ tests:
252222
- class: org.elasticsearch.search.basic.SearchWithRandomDisconnectsIT
253223
method: testSearchWithRandomDisconnects
254224
issue: https://github.com/elastic/elasticsearch/issues/122707
255-
- class: org.elasticsearch.packaging.test.DockerTests
256-
method: test020PluginsListWithNoPlugins
257-
issue: https://github.com/elastic/elasticsearch/issues/126232
258225
- class: org.elasticsearch.xpack.test.rest.XPackRestIT
259226
method: test {p0=transform/transforms_reset/Test force reseting a running transform}
260227
issue: https://github.com/elastic/elasticsearch/issues/126240
@@ -264,15 +231,9 @@ tests:
264231
- class: org.elasticsearch.xpack.test.rest.XPackRestIT
265232
method: test {p0=ml/start_data_frame_analytics/Test start classification analysis when the dependent variable cardinality is too low}
266233
issue: https://github.com/elastic/elasticsearch/issues/126299
267-
- class: org.elasticsearch.packaging.test.DockerTests
268-
method: test023InstallPluginUsingConfigFile
269-
issue: https://github.com/elastic/elasticsearch/issues/126145
270234
- class: org.elasticsearch.smoketest.MlWithSecurityIT
271235
method: test {yaml=ml/start_data_frame_analytics/Test start classification analysis when the dependent variable cardinality is too low}
272236
issue: https://github.com/elastic/elasticsearch/issues/123200
273-
- class: org.elasticsearch.packaging.test.DockerTests
274-
method: test022InstallPluginsFromLocalArchive
275-
issue: https://github.com/elastic/elasticsearch/issues/116866
276237
- class: org.elasticsearch.smoketest.MlWithSecurityIT
277238
method: test {yaml=ml/trained_model_cat_apis/Test cat trained models}
278239
issue: https://github.com/elastic/elasticsearch/issues/125750
@@ -315,15 +276,6 @@ tests:
315276
- class: org.elasticsearch.cli.keystore.AddStringKeyStoreCommandTests
316277
method: testStdinWithMultipleValues
317278
issue: https://github.com/elastic/elasticsearch/issues/126882
318-
- class: org.elasticsearch.packaging.test.DockerTests
319-
method: test024InstallPluginFromArchiveUsingConfigFile
320-
issue: https://github.com/elastic/elasticsearch/issues/126936
321-
- class: org.elasticsearch.packaging.test.DockerTests
322-
method: test026InstallBundledRepositoryPlugins
323-
issue: https://github.com/elastic/elasticsearch/issues/127081
324-
- class: org.elasticsearch.packaging.test.DockerTests
325-
method: test026InstallBundledRepositoryPluginsViaConfigFile
326-
issue: https://github.com/elastic/elasticsearch/issues/127158
327279
- class: org.elasticsearch.xpack.remotecluster.CrossClusterEsqlRCS2EnrichUnavailableRemotesIT
328280
method: testEsqlEnrichWithSkipUnavailable
329281
issue: https://github.com/elastic/elasticsearch/issues/127368
@@ -339,48 +291,18 @@ tests:
339291
- class: org.elasticsearch.backwards.MixedClusterClientYamlTestSuiteIT
340292
method: test {p0=search/350_point_in_time/point-in-time with index filter}
341293
issue: https://github.com/elastic/elasticsearch/issues/127741
342-
- class: org.elasticsearch.packaging.test.DockerTests
343-
method: test025SyncPluginsUsingProxy
344-
issue: https://github.com/elastic/elasticsearch/issues/127138
345294
- class: org.elasticsearch.xpack.esql.action.CrossClusterQueryWithPartialResultsIT
346295
method: testOneRemoteClusterPartial
347296
issue: https://github.com/elastic/elasticsearch/issues/124055
348297
- class: org.elasticsearch.xpack.esql.qa.multi_node.EsqlSpecIT
349298
method: test {lookup-join.MvJoinKeyOnTheLookupIndex ASYNC}
350299
issue: https://github.com/elastic/elasticsearch/issues/128030
351-
- class: org.elasticsearch.packaging.test.DockerTests
352-
method: test042KeystorePermissionsAreCorrect
353-
issue: https://github.com/elastic/elasticsearch/issues/128018
354-
- class: org.elasticsearch.packaging.test.DockerTests
355-
method: test072RunEsAsDifferentUserAndGroup
356-
issue: https://github.com/elastic/elasticsearch/issues/128031
357-
- class: org.elasticsearch.packaging.test.DockerTests
358-
method: test122CanUseDockerLoggingConfig
359-
issue: https://github.com/elastic/elasticsearch/issues/128110
360-
- class: org.elasticsearch.packaging.test.DockerTests
361-
method: test041AmazonCaCertsAreInTheKeystore
362-
issue: https://github.com/elastic/elasticsearch/issues/128006
363-
- class: org.elasticsearch.packaging.test.DockerTests
364-
method: test130JavaHasCorrectOwnership
365-
issue: https://github.com/elastic/elasticsearch/issues/128174
366-
- class: org.elasticsearch.packaging.test.DockerTests
367-
method: test600Interrupt
368-
issue: https://github.com/elastic/elasticsearch/issues/128144
369300
- class: org.elasticsearch.packaging.test.EnrollmentProcessTests
370301
method: test20DockerAutoFormCluster
371302
issue: https://github.com/elastic/elasticsearch/issues/128113
372-
- class: org.elasticsearch.packaging.test.DockerTests
373-
method: test121CanUseStackLoggingConfig
374-
issue: https://github.com/elastic/elasticsearch/issues/128165
375-
- class: org.elasticsearch.packaging.test.DockerTests
376-
method: test080ConfigurePasswordThroughEnvironmentVariableFile
377-
issue: https://github.com/elastic/elasticsearch/issues/128075
378303
- class: org.elasticsearch.ingest.geoip.GeoIpDownloaderCliIT
379304
method: testInvalidTimestamp
380305
issue: https://github.com/elastic/elasticsearch/issues/128284
381-
- class: org.elasticsearch.packaging.test.DockerTests
382-
method: test120DockerLogsIncludeElasticsearchLogs
383-
issue: https://github.com/elastic/elasticsearch/issues/128117
384306
- class: org.elasticsearch.packaging.test.TemporaryDirectoryConfigTests
385307
method: test21AcceptsCustomPathInDocker
386308
issue: https://github.com/elastic/elasticsearch/issues/128114
@@ -396,27 +318,9 @@ tests:
396318
- class: org.elasticsearch.xpack.esql.action.CrossClusterQueryWithPartialResultsIT
397319
method: testFailToStartRequestOnRemoteCluster
398320
issue: https://github.com/elastic/elasticsearch/issues/128545
399-
- class: org.elasticsearch.packaging.test.DockerTests
400-
method: test124CanRestartContainerWithStackLoggingConfig
401-
issue: https://github.com/elastic/elasticsearch/issues/128121
402-
- class: org.elasticsearch.packaging.test.DockerTests
403-
method: test085EnvironmentVariablesAreRespectedUnderDockerExec
404-
issue: https://github.com/elastic/elasticsearch/issues/128115
405321
- class: org.elasticsearch.compute.operator.LimitOperatorTests
406322
method: testEarlyTermination
407323
issue: https://github.com/elastic/elasticsearch/issues/128721
408-
- class: org.elasticsearch.packaging.test.DockerTests
409-
method: test040JavaUsesTheOsProvidedKeystore
410-
issue: https://github.com/elastic/elasticsearch/issues/128230
411-
- class: org.elasticsearch.packaging.test.DockerTests
412-
method: test150MachineDependentHeap
413-
issue: https://github.com/elastic/elasticsearch/issues/128120
414-
- class: org.elasticsearch.packaging.test.DockerTests
415-
method: test073RunEsAsDifferentUserAndGroupWithoutBindMounting
416-
issue: https://github.com/elastic/elasticsearch/issues/128996
417-
- class: org.elasticsearch.packaging.test.DockerTests
418-
method: test081SymlinksAreFollowedWithEnvironmentVariableFiles
419-
issue: https://github.com/elastic/elasticsearch/issues/128867
420324
- class: org.elasticsearch.xpack.esql.qa.single_node.GenerativeForkIT
421325
method: test {lookup-join.EnrichLookupStatsBug ASYNC}
422326
issue: https://github.com/elastic/elasticsearch/issues/129228
@@ -505,9 +409,6 @@ tests:
505409
- class: org.elasticsearch.search.SearchWithRejectionsIT
506410
method: testOpenContextsAfterRejections
507411
issue: https://github.com/elastic/elasticsearch/issues/130821
508-
- class: org.elasticsearch.packaging.test.DockerTests
509-
method: test082CannotUseEnvVarsAndFiles
510-
issue: https://github.com/elastic/elasticsearch/issues/129808
511412
- class: org.elasticsearch.xpack.esql.action.EsqlActionBreakerIT
512413
method: testExtractFields
513414
issue: https://github.com/elastic/elasticsearch/issues/130501

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
@@ -151,7 +151,19 @@ private static HttpResponse execute(Request request, String username, String pas
151151
executor.auth(username, password);
152152
executor.authPreemptive(new HttpHost("localhost", 9200));
153153
}
154-
return executor.execute(request).returnResponse();
154+
try {
155+
return executor.execute(request).returnResponse();
156+
} catch (Exception e) {
157+
logger.warn(
158+
"Failed to execute request [{}] with username/password [{}/{}] and caCert [{}]",
159+
request.toString(),
160+
username,
161+
password,
162+
caCert,
163+
e
164+
);
165+
throw e;
166+
}
155167
}
156168

157169
// polls every two seconds for Elasticsearch to be running on 9200
@@ -239,14 +251,13 @@ public static void waitForElasticsearch(
239251
long timeElapsed = 0;
240252
boolean started = false;
241253
Throwable thrownException = null;
242-
if (caCert == null) {
243-
caCert = getCaCert(installation);
244-
}
245254

246255
while (started == false && timeElapsed < waitTime) {
247256
if (System.currentTimeMillis() - lastRequest > requestInterval) {
257+
if (caCert == null) {
258+
caCert = getCaCert(installation);
259+
}
248260
try {
249-
250261
final HttpResponse response = execute(
251262
Request.Get((caCert != null ? "https" : "http") + "://localhost:9200/_cluster/health")
252263
.connectTimeout((int) timeoutLength)
@@ -277,7 +288,7 @@ public static void waitForElasticsearch(
277288
}
278289
started = true;
279290

280-
} catch (IOException e) {
291+
} catch (Exception e) {
281292
if (thrownException == null) {
282293
thrownException = e;
283294
} 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)