Remove timeout in JAXBCoderTest The infrastructure should kill the test if the await does not return.
Project: http://git-wip-us.apache.org/repos/asf/incubator-beam/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-beam/commit/88a6cf5e Tree: http://git-wip-us.apache.org/repos/asf/incubator-beam/tree/88a6cf5e Diff: http://git-wip-us.apache.org/repos/asf/incubator-beam/diff/88a6cf5e Branch: refs/heads/master Commit: 88a6cf5e3793c9ecff664119be88349f94a37694 Parents: c595631 Author: Thomas Groh <tg...@google.com> Authored: Tue Sep 6 11:13:07 2016 -0700 Committer: Dan Halperin <dhalp...@google.com> Committed: Tue Sep 6 15:09:46 2016 -0700 ---------------------------------------------------------------------- .../java/org/apache/beam/sdk/coders/JAXBCoderTest.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/88a6cf5e/sdks/java/core/src/test/java/org/apache/beam/sdk/coders/JAXBCoderTest.java ---------------------------------------------------------------------- diff --git a/sdks/java/core/src/test/java/org/apache/beam/sdk/coders/JAXBCoderTest.java b/sdks/java/core/src/test/java/org/apache/beam/sdk/coders/JAXBCoderTest.java index 129be61..36190f9 100644 --- a/sdks/java/core/src/test/java/org/apache/beam/sdk/coders/JAXBCoderTest.java +++ b/sdks/java/core/src/test/java/org/apache/beam/sdk/coders/JAXBCoderTest.java @@ -18,7 +18,6 @@ package org.apache.beam.sdk.coders; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; import com.google.common.collect.ImmutableList; import java.io.IOException; @@ -28,7 +27,6 @@ import java.util.List; import java.util.concurrent.CountDownLatch; import java.util.concurrent.Executor; import java.util.concurrent.Executors; -import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicReference; import javax.xml.bind.annotation.XmlRootElement; import org.apache.beam.sdk.testing.CoderProperties; @@ -119,7 +117,7 @@ public class JAXBCoderTest { @Test public void testEncodeDecodeMultithreaded() throws Throwable { final JAXBCoder<TestType> coder = JAXBCoder.of(TestType.class); - int numThreads = 1000; + int numThreads = 100; final CountDownLatch ready = new CountDownLatch(numThreads); final CountDownLatch start = new CountDownLatch(1); @@ -155,11 +153,10 @@ public class JAXBCoderTest { ready.await(); start.countDown(); - if (!done.await(10L, TimeUnit.SECONDS)) { - fail("Should be able to clone " + numThreads + " elements in 10 seconds"); - } - if (thrown.get() != null) { - throw thrown.get(); + done.await(); + Throwable actuallyThrown = thrown.get(); + if (actuallyThrown != null) { + throw actuallyThrown; } }