ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jonathanhur...@apache.org
Subject ambari git commit: AMBARI-15895 - AlertReceivedListenerTest is Flaky When Running @Before Code (jonathanhurley)
Date Thu, 14 Apr 2016 21:06:30 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 1a782858d -> d050e74b9


AMBARI-15895 - AlertReceivedListenerTest is Flaky When Running @Before Code (jonathanhurley)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/d050e74b
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/d050e74b
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/d050e74b

Branch: refs/heads/branch-2.2
Commit: d050e74b9b53e11969e1cfc21a929f88ca4571b9
Parents: 1a78285
Author: Jonathan Hurley <jhurley@hortonworks.com>
Authored: Thu Apr 14 15:26:18 2016 -0400
Committer: Jonathan Hurley <jhurley@hortonworks.com>
Committed: Thu Apr 14 17:06:13 2016 -0400

----------------------------------------------------------------------
 ambari-project/pom.xml                                            | 3 ++-
 .../ambari/server/state/alerts/AlertReceivedListenerTest.java     | 3 +++
 2 files changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/d050e74b/ambari-project/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-project/pom.xml b/ambari-project/pom.xml
index 076e88f..2a4c124 100644
--- a/ambari-project/pom.xml
+++ b/ambari-project/pom.xml
@@ -507,8 +507,9 @@
         <artifactId>maven-surefire-plugin</artifactId>
         <configuration>
           <redirectTestOutputToFile>true</redirectTestOutputToFile>
-          <forkMode>always</forkMode>
           <forkedProcessTimeoutInSeconds>900</forkedProcessTimeoutInSeconds>
+          <reuseForks>false</reuseForks>
+          <forkCount>1</forkCount>
         </configuration>
       </plugin>
       <plugin>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d050e74b/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertReceivedListenerTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertReceivedListenerTest.java
b/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertReceivedListenerTest.java
index 0d893af..2c30259 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertReceivedListenerTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertReceivedListenerTest.java
@@ -50,6 +50,7 @@ import org.junit.Test;
 import com.google.inject.Guice;
 import com.google.inject.Injector;
 import com.google.inject.persist.PersistService;
+import com.google.inject.persist.UnitOfWork;
 
 /**
  * Tests the {@link AlertReceivedListener}.
@@ -75,6 +76,7 @@ public class AlertReceivedListenerTest {
   public void setup() throws Exception {
     m_injector = Guice.createInjector(new InMemoryDefaultTestModule());
     m_injector.getInstance(GuiceJpaInitializer.class);
+    m_injector.getInstance(UnitOfWork.class).begin();
 
     m_helper = m_injector.getInstance(OrmTestHelper.class);
     m_clusters = m_injector.getInstance(Clusters.class);
@@ -115,6 +117,7 @@ public class AlertReceivedListenerTest {
 
   @After
   public void teardown() {
+    m_injector.getInstance(UnitOfWork.class).end();
     m_injector.getInstance(PersistService.class).stop();
     m_injector = null;
   }


Mime
View raw message