add comment for ignoring test and add test for thread stucking

This commit is contained in:
nishantmonu51 2014-05-16 19:48:12 +05:30
parent da285d8665
commit b4a791a035
1 changed files with 37 additions and 0 deletions

View File

@ -19,6 +19,7 @@
package io.druid.server.initialization; package io.druid.server.initialization;
import com.google.api.client.repackaged.com.google.common.base.Throwables;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.ListenableFuture;
import com.google.inject.Binder; import com.google.inject.Binder;
@ -173,6 +174,7 @@ public class JettyTest
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=424107 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=424107
@Test @Test
@Ignore @Ignore
// above bug is not fixed in jetty for gzip encoding, and the chunk is still finalized instead of throwing exception.
public void testChunkNotFinalized() throws Exception public void testChunkNotFinalized() throws Exception
{ {
ListenableFuture<InputStream> go = client.get( ListenableFuture<InputStream> go = client.get(
@ -193,6 +195,41 @@ public class JettyTest
} }
@Test
public void testThreadNotStuckOnException() throws Exception
{
final CountDownLatch latch = new CountDownLatch(1);
Executors.newSingleThreadExecutor().execute(
new Runnable()
{
@Override
public void run()
{
try {
ListenableFuture<InputStream> go = client.get(
new URL(
"http://localhost:9999/exception/exception"
)
)
.go(new InputStreamResponseHandler());
StringWriter writer = new StringWriter();
IOUtils.copy(go.get(), writer, "utf-8");
}
catch (IOException e) {
// Expected.
}
catch (Throwable t) {
Throwables.propagate(t);
}
latch.countDown();
}
}
);
latch.await(5, TimeUnit.SECONDS);
}
@After @After
public void teardown() public void teardown()
{ {