You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by jo...@apache.org on 2016/04/14 23:05:25 UTC
ambari git commit: AMBARI-15895 - AlertReceivedListenerTest is Flaky
When Running @Before Code (jonathanhurley)
Repository: ambari
Updated Branches:
refs/heads/trunk f2b3c2a76 -> 683b7893c
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/683b7893
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/683b7893
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/683b7893
Branch: refs/heads/trunk
Commit: 683b7893cd88b5d911424bce6fe541a0243a8b48
Parents: f2b3c2a
Author: Jonathan Hurley <jh...@hortonworks.com>
Authored: Thu Apr 14 15:26:18 2016 -0400
Committer: Jonathan Hurley <jh...@hortonworks.com>
Committed: Thu Apr 14 17:04:58 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/683b7893/ambari-project/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-project/pom.xml b/ambari-project/pom.xml
index 21c5baf..2fbb1e1 100644
--- a/ambari-project/pom.xml
+++ b/ambari-project/pom.xml
@@ -505,8 +505,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/683b7893/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 28aa19a..2ea65df 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
@@ -58,6 +58,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}.
@@ -83,6 +84,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);
@@ -123,6 +125,7 @@ public class AlertReceivedListenerTest {
@After
public void teardown() {
+ m_injector.getInstance(UnitOfWork.class).end();
m_injector.getInstance(PersistService.class).stop();
m_injector = null;
}