Browse Source

Fix stopping of old elasticsearch cluster (#81059)

due to not exposing the PID of the underlaying cluster the Fixture Stop task
was skipped, leaving running clusters behind after the build finished
Rene Groeschke 3 years ago
parent
commit
c2b62847aa

+ 4 - 0
test/fixtures/old-elasticsearch/src/main/java/oldes/OldElasticsearch.java

@@ -132,5 +132,9 @@ public class OldElasticsearch {
         Path tmp = Files.createTempFile(baseDir, null, null);
         Files.write(tmp, Integer.toString(port).getBytes(StandardCharsets.UTF_8));
         Files.move(tmp, baseDir.resolve("ports"), StandardCopyOption.ATOMIC_MOVE);
+
+        tmp = Files.createTempFile(baseDir, null, null);
+        Files.write(tmp, Integer.toString(pid).getBytes(StandardCharsets.UTF_8));
+        Files.move(tmp, baseDir.resolve("pid"), StandardCopyOption.ATOMIC_MOVE);
     }
 }