From 1f43fadd5630e1b992e63635edd336893ec7245f Mon Sep 17 00:00:00 2001 From: Mark Vieira Date: Mon, 15 Nov 2021 15:13:26 -0800 Subject: [PATCH] Fix DockerTests.test022InstallPlugin assertion (#80741) Use order agnostic assertion when testing plugin installation. https://gradle-enterprise.elastic.co/s/57wwszvhfzwnw/tests/:qa:os:destructiveDistroTest.default-dockerCloud/org.elasticsearch.packaging.test.DockerTests/test022InstallPlugin @pugnascotia This will likely need to be included in your backport of #80734 # Conflicts: # qa/os/src/test/java/org/elasticsearch/packaging/test/DockerTests.java --- .../org/elasticsearch/packaging/test/DockerTests.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/qa/os/src/test/java/org/elasticsearch/packaging/test/DockerTests.java b/qa/os/src/test/java/org/elasticsearch/packaging/test/DockerTests.java index c303638ee9dcc..a281b4c5933b9 100644 --- a/qa/os/src/test/java/org/elasticsearch/packaging/test/DockerTests.java +++ b/qa/os/src/test/java/org/elasticsearch/packaging/test/DockerTests.java @@ -19,6 +19,7 @@ import org.elasticsearch.packaging.util.Shell.Result; import org.elasticsearch.packaging.util.docker.DockerRun; import org.elasticsearch.packaging.util.docker.MockServer; +import org.hamcrest.Matcher; import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; @@ -187,11 +188,11 @@ public void test022InstallPlugin() { final boolean isCloudImage = distribution().packaging == Packaging.DOCKER_CLOUD || distribution().packaging == Packaging.DOCKER_CLOUD_ESS; - final List expectedPlugins = isCloudImage - ? asList("analysis-icu", "repository-azure", "repository-gcs", "repository-s3") - : asList("analysis-icu"); + final Matcher> matcher = isCloudImage + ? containsInAnyOrder("repository-azure", "repository-gcs", "repository-s3", "analysis-icu") + : equalTo(List.of("analysis-icu")); - assertThat("Expected installed plugins to be listed", listPlugins(), equalTo(expectedPlugins)); + assertThat("Expected installed plugins to be listed", listPlugins(), matcher); } /**