This is an automated email from the ASF dual-hosted git repository.

kmarton pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/oozie.git


The following commit(s) were added to refs/heads/master by this push:
     new 2ecac7e  OOZIE-3421 [tests] GitServer lifecycle fixes (andras.piros 
via kmarton)
2ecac7e is described below

commit 2ecac7e8cd080551ba8606dfaedc0649a87f3a35
Author: Julia Kinga Marton <[email protected]>
AuthorDate: Tue Jan 15 07:43:04 2019 +0100

    OOZIE-3421 [tests] GitServer lifecycle fixes (andras.piros via kmarton)
---
 release-log.txt                                               |  1 +
 .../test/java/org/apache/oozie/action/hadoop/GitServer.java   | 11 +++++++++++
 2 files changed, 12 insertions(+)

diff --git a/release-log.txt b/release-log.txt
index 9221995..a0734a6 100644
--- a/release-log.txt
+++ b/release-log.txt
@@ -1,5 +1,6 @@
 -- Oozie 5.2.0 release (trunk - unreleased)
 
+OOZIE-3421 [tests] GitServer lifecycle fixes (andras.piros via kmarton)
 OOZIE-3415 [core] libpath cannot be used together with coord.application.path 
and bundle.application.path (asalamon74 via andras.piros)
 OOZIE-3407 [tests] Cleanup TestPurgeXCommand (asalamon74 via andras.piros)
 OOZIE-3067 [core] Remove duplicate logic from ZKJobsConcurrencyService 
(dionusos via andras.piros)
diff --git 
a/sharelib/git/src/test/java/org/apache/oozie/action/hadoop/GitServer.java 
b/sharelib/git/src/test/java/org/apache/oozie/action/hadoop/GitServer.java
index 03d6e55..8398e5f 100644
--- a/sharelib/git/src/test/java/org/apache/oozie/action/hadoop/GitServer.java
+++ b/sharelib/git/src/test/java/org/apache/oozie/action/hadoop/GitServer.java
@@ -62,6 +62,12 @@ class GitServer {
     }
 
     void start() throws IOException {
+        if (this.server != null && this.server.isRunning()) {
+            LOG.warn("Git server has already been started on port {0}, not 
trying to start again",
+                    this.server.getAddress().getPort());
+            return;
+        }
+
         LOG.info("Starting Git server on port {0}", this.localPort);
 
         this.server = new Daemon(new InetSocketAddress(this.localPort));
@@ -86,6 +92,11 @@ class GitServer {
 
     void stopAndCleanupReposServer() {
         cleanUpRepos();
+        if (this.server == null || !this.server.isRunning()) {
+            LOG.warn("Git server is not running, not trying to stop");
+            return;
+        }
+
         this.server.stop();
     }
 

Reply via email to