Merge pull request #2213 from himanshug/fix_curtator_test_base

[wip] trying/finding fix for announcer test failures
This commit is contained in:
Fangjin Yang 2016-01-07 18:23:49 -08:00
commit 15fc070232
2 changed files with 10 additions and 6 deletions

View File

@ -20,9 +20,8 @@
package io.druid.curator; package io.druid.curator;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.api.client.repackaged.com.google.common.base.Throwables; import com.google.common.base.Throwables;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
import com.metamx.common.guava.CloseQuietly;
import io.druid.client.DruidServer; import io.druid.client.DruidServer;
import io.druid.server.initialization.ZkPathsConfig; import io.druid.server.initialization.ZkPathsConfig;
import io.druid.timeline.DataSegment; import io.druid.timeline.DataSegment;
@ -35,6 +34,8 @@ import org.apache.curator.utils.ZKPaths;
import org.apache.zookeeper.CreateMode; import org.apache.zookeeper.CreateMode;
import org.apache.zookeeper.KeeperException; import org.apache.zookeeper.KeeperException;
import java.io.IOException;
/** /**
*/ */
public class CuratorTestBase public class CuratorTestBase
@ -152,8 +153,13 @@ public class CuratorTestBase
protected void tearDownServerAndCurator() protected void tearDownServerAndCurator()
{ {
CloseQuietly.close(curator); try {
CloseQuietly.close(server); curator.close();
server.close();
} catch(IOException ex)
{
throw Throwables.propagate(ex);
}
} }
} }

View File

@ -32,7 +32,6 @@ import org.apache.zookeeper.data.Stat;
import org.junit.After; import org.junit.After;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Before; import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test; import org.junit.Test;
import java.util.Set; import java.util.Set;
@ -128,7 +127,6 @@ public class AnnouncerTest extends CuratorTestBase
Assert.assertNull("expect /somewhere/test2 unannounced", curator.checkExists().forPath(testPath2)); Assert.assertNull("expect /somewhere/test2 unannounced", curator.checkExists().forPath(testPath2));
} }
@Ignore // https://github.com/druid-io/druid/issues/2167
@Test(timeout = 60_000L) @Test(timeout = 60_000L)
public void testSessionKilled() throws Exception public void testSessionKilled() throws Exception
{ {