Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ tests:
- class: org.elasticsearch.packaging.test.WindowsServiceTests
method: test30StartStop
issue: https://github.com/elastic/elasticsearch/issues/113160
- class: org.elasticsearch.packaging.test.WindowsServiceTests
method: test33JavaChanged
issue: https://github.com/elastic/elasticsearch/issues/113177
- class: org.elasticsearch.packaging.test.WindowsServiceTests
method: test80JavaOptsInEnvVar
issue: https://github.com/elastic/elasticsearch/issues/113219
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,21 @@ public void assertStartedAndStop() throws Exception {
runElasticsearchTests();

assertCommand(serviceScript + " stop");
assertStopped();

assertCommand(serviceScript + " remove");
assertCommand(
"$p = Get-Service -Name \"elasticsearch-service-x64\" -ErrorAction SilentlyContinue;"
+ "echo \"$p\";"
+ "if ($p -eq $Null) {"
+ " exit 0;"
+ "} else {"
+ " exit 1;"
+ "}"
);
}

private void assertStopped() {
assertService(DEFAULT_ID, "Stopped");
// the process is stopped async, and can become a zombie process, so we poll for the process actually being gone
assertCommand(
Expand All @@ -170,17 +185,6 @@ public void assertStartedAndStop() throws Exception {
+ "} while ($i -lt 300);"
+ "exit 9;"
);

assertCommand(serviceScript + " remove");
assertCommand(
"$p = Get-Service -Name \"elasticsearch-service-x64\" -ErrorAction SilentlyContinue;"
+ "echo \"$p\";"
+ "if ($p -eq $Null) {"
+ " exit 0;"
+ "} else {"
+ " exit 1;"
+ "}"
);
}

public void test30StartStop() throws Exception {
Expand All @@ -205,16 +209,22 @@ public void test32StopNotStarted() throws IOException {
public void test33JavaChanged() throws Exception {
final Path alternateJdk = installation.bundledJdk.getParent().resolve("jdk.copy");

try {
copyDirectory(installation.bundledJdk, alternateJdk);
sh.getEnv().put("ES_JAVA_HOME", alternateJdk.toString());
assertCommand(serviceScript + " install");
sh.getEnv().remove("ES_JAVA_HOME");
assertCommand(serviceScript + " start");
assertStartedAndStop();
} finally {
FileUtils.rm(alternateJdk);
}
copyDirectory(installation.bundledJdk, alternateJdk);
sh.getEnv().put("ES_JAVA_HOME", alternateJdk.toString());
assertCommand(serviceScript + " install");
sh.getEnv().remove("ES_JAVA_HOME");
assertCommand(serviceScript + " start");
assertStartedAndStop();
}

public void test34StartStopStart() throws Exception {
assertCommand(serviceScript + " install");
assertCommand(serviceScript + " start");
ServerUtils.waitForElasticsearch(installation);
assertCommand(serviceScript + " stop");
assertStopped();
assertCommand(serviceScript + " start");
assertStartedAndStop();
}

public void test80JavaOptsInEnvVar() throws Exception {
Expand Down