[
https://issues.apache.org/jira/browse/PHOENIX-2822?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15230507#comment-15230507
]
ASF GitHub Bot commented on PHOENIX-2822:
-----------------------------------------
Github user samarthjain commented on a diff in the pull request:
https://github.com/apache/phoenix/pull/158#discussion_r58902469
--- Diff:
phoenix-core/src/test/java/org/apache/phoenix/memory/MemoryManagerTest.java ---
@@ -69,35 +76,38 @@ private static void sleepFor(long time) {
}
@Test
- public void testWaitForMemoryAvailable() {
- final GlobalMemoryManager gmm = new GlobalMemoryManager(100,8000);
+ public void testWaitForMemoryAvailable() throws Exception {
+ final GlobalMemoryManager gmm = spy(new GlobalMemoryManager(100,
80));
final ChildMemoryManager rmm1 = new ChildMemoryManager(gmm,100);
final ChildMemoryManager rmm2 = new ChildMemoryManager(gmm,100);
+ final CountDownLatch latch = new CountDownLatch(2);
Thread t1 = new Thread() {
@Override
public void run() {
MemoryChunk c1 = rmm1.allocate(50);
MemoryChunk c2 = rmm1.allocate(50);
- sleepFor(4000);
+ sleepFor(40);
c1.close();
- sleepFor(2000);
+ sleepFor(20);
c2.close();
+ latch.countDown();
}
};
Thread t2 = new Thread() {
@Override
public void run() {
- sleepFor(2000);
+ sleepFor(20);
// Will require waiting for a bit of time before t1 frees
the requested memory
- long startTime = System.currentTimeMillis();
+ Stopwatch watch = new Stopwatch().start();
--- End diff --
Actually, I don't see this watch being used anywhere. Make sure you have
the phoenix eclipse preferences imported. This should have been flagged as an
unused variable warning.
> Tests that extend BaseHBaseManagedTimeIT are very slow
> ------------------------------------------------------
>
> Key: PHOENIX-2822
> URL: https://issues.apache.org/jira/browse/PHOENIX-2822
> Project: Phoenix
> Issue Type: Improvement
> Affects Versions: 4.8.0
> Reporter: churro morales
> Assignee: churro morales
> Labels: HBASEDEPENDENCIES
>
> Since I am trying to refactor out all the hbase private dependencies, I have
> to constantly run tests to make sure I didn't break anything. The tests that
> extend BaseHBaseManagedTimeIT are very slow as they have to delete all
> non-system tables after every test case. This takes around 5-10 seconds to
> accomplish. This adds significant time to the test suite.
> I created a new class named: BaseHBaseManagedTimeTableReuseIT and it creates
> a random table name such that we dont have collisions for tests. It also
> doesn't do any cleanup after each test case or class because these table
> names should be unique. I moved about 30-35 tests out from
> BaseHBaseManagedTimeIT to BaseHBaseManagedTimeTableReuseIT and it
> significantly improved the overall time it takes to run tests.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)