-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Make docker tests more reliable #68512
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,7 @@ | |
import java.util.stream.Collectors; | ||
|
||
import static java.nio.file.attribute.PosixFilePermissions.fromString; | ||
import static org.elasticsearch.packaging.util.Docker.assertPermissionsAndOwnership; | ||
import static org.elasticsearch.packaging.util.Docker.chownWithPrivilegeEscalation; | ||
import static org.elasticsearch.packaging.util.Docker.copyFromContainer; | ||
import static org.elasticsearch.packaging.util.Docker.existsInContainer; | ||
|
@@ -97,9 +98,7 @@ public void teardownTest() { | |
/** | ||
* Checks that the Docker image can be run, and that it passes various checks. | ||
*/ | ||
public void test010Install() throws Exception { | ||
// Wait for the container to come up, because we assert the state of some files that Elasticsearch creates on startup. | ||
waitForElasticsearch(installation); | ||
pugnascotia marked this conversation as resolved.
Show resolved
Hide resolved
|
||
public void test010Install() { | ||
verifyContainerInstallation(installation, distribution()); | ||
} | ||
|
||
|
@@ -146,6 +145,15 @@ public void test041AmazonCaCertsAreInTheKeystore() { | |
assertTrue("Expected Amazon trusted cert in cacerts", matches); | ||
} | ||
|
||
/** | ||
* Check that when the keystore is created on startup, it is created with the correct permissions. | ||
*/ | ||
public void test042KeystorePermissionsAreCorrect() throws Exception { | ||
waitForElasticsearch(installation); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The failures seem to indicate that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure that I removed the keystore from the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure, I guess my point being that the new test you added is still susceptible to the same underlying cause of those other failures, unless I'm missing something. Indeed I agree we don't need superfluous assertions in those other tests, so if nothing else this should fail less often. We'll keep an eye on it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Basically this - if the new test is failing often, at least I have somewhere more specific to start investigating. |
||
|
||
assertPermissionsAndOwnership(installation.config("elasticsearch.keystore"), p660); | ||
} | ||
|
||
/** | ||
* Send some basic index, count and delete requests, in order to check that the installation | ||
* is minimally functional. | ||
|
@@ -183,7 +191,7 @@ public void test070BindMountCustomPathConfAndJvmOptions() throws Exception { | |
|
||
waitForElasticsearch(installation); | ||
|
||
final JsonNode nodes = getJson("_nodes").get("nodes"); | ||
final JsonNode nodes = getJson("/_nodes").get("nodes"); | ||
final String nodeId = nodes.fieldNames().next(); | ||
|
||
final int heapSize = nodes.at("/" + nodeId + "/jvm/mem/heap_init_in_bytes").intValue(); | ||
|
@@ -211,7 +219,7 @@ public void test071BindMountCustomPathWithDifferentUID() throws Exception { | |
|
||
waitForElasticsearch(installation); | ||
|
||
final JsonNode nodes = getJson("_nodes"); | ||
final JsonNode nodes = getJson("/_nodes"); | ||
|
||
assertThat(nodes.at("/_nodes/total").intValue(), equalTo(1)); | ||
assertThat(nodes.at("/_nodes/successful").intValue(), equalTo(1)); | ||
|
@@ -718,7 +726,7 @@ public void test131InitProcessHasCorrectPID() { | |
public void test140CgroupOsStatsAreAvailable() throws Exception { | ||
waitForElasticsearch(installation); | ||
|
||
final JsonNode nodes = getJson("_nodes/stats/os").get("nodes"); | ||
final JsonNode nodes = getJson("/_nodes/stats/os").get("nodes"); | ||
|
||
final String nodeId = nodes.fieldNames().next(); | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.