[
https://issues.apache.org/jira/browse/BEAM-4088?focusedWorklogId=99615&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-99615
]
ASF GitHub Bot logged work on BEAM-4088:
----------------------------------------
Author: ASF GitHub Bot
Created on: 08/May/18 16:46
Start Date: 08/May/18 16:46
Worklog Time Spent: 10m
Work Description: tgroh closed pull request #5300: [BEAM-4088] Suppress a
test in ExecutorServiceParallelExecutorTest
URL: https://github.com/apache/beam/pull/5300
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git
a/runners/direct-java/src/test/java/org/apache/beam/runners/direct/ExecutorServiceParallelExecutorTest.java
b/runners/direct-java/src/test/java/org/apache/beam/runners/direct/ExecutorServiceParallelExecutorTest.java
index 33cf619a753..53270498d12 100644
---
a/runners/direct-java/src/test/java/org/apache/beam/runners/direct/ExecutorServiceParallelExecutorTest.java
+++
b/runners/direct-java/src/test/java/org/apache/beam/runners/direct/ExecutorServiceParallelExecutorTest.java
@@ -35,16 +35,14 @@
import org.apache.beam.sdk.testing.ThreadLeakTracker;
import org.apache.beam.sdk.transforms.DoFn;
import org.apache.beam.sdk.transforms.ParDo;
-import org.joda.time.Duration;
import org.joda.time.Instant;
+import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TestName;
import org.junit.rules.TestRule;
-/**
- * Validates some basic behavior for the ExecutorServiceParallelExecutor.
- */
+/** Validates some basic behavior for the ExecutorServiceParallelExecutor. */
public class ExecutorServiceParallelExecutorTest {
private static final long NUM_ELEMENTS = 1000L;
@@ -52,50 +50,52 @@
private final TestPipeline pipeline = TestPipeline.create();
private final TestRule threadLeakTracker = new ThreadLeakTracker();
- @Rule
- public final TestRule execution =
outerRule(pipeline).around(threadLeakTracker);
+ @Rule public final TestRule execution =
outerRule(pipeline).around(threadLeakTracker);
- @Rule
- public final TestName testName = new TestName();
+ @Rule public final TestName testName = new TestName();
@Test
+ @Ignore("https://issues.apache.org/jira/browse/BEAM-4088 Test reliably
fails.")
public void ensureMetricsThreadDoesntLeak() {
- final DirectGraph graph = DirectGraph.create(
- emptyMap(), emptyMap(), LinkedListMultimap.create(),
- emptySet(), emptyMap());
- final ExecutorService metricsExecutorService =
Executors.newSingleThreadExecutor(
- new ThreadFactoryBuilder()
- .setDaemon(false)
- .setNameFormat("dontleak_" + getClass().getName() + "#" +
testName.getMethodName())
- .build());
+ final DirectGraph graph =
+ DirectGraph.create(
+ emptyMap(), emptyMap(), LinkedListMultimap.create(), emptySet(),
emptyMap());
+ final ExecutorService metricsExecutorService =
+ Executors.newSingleThreadExecutor(
+ new ThreadFactoryBuilder()
+ .setDaemon(false)
+ .setNameFormat("dontleak_" + getClass().getName() + "#" +
testName.getMethodName())
+ .build());
// fake a metrics usage
metricsExecutorService.submit(() -> {});
- final EvaluationContext context = EvaluationContext.create(
- MockClock.fromInstant(Instant.now()),
- CloningBundleFactory.create(), graph, emptySet(),
metricsExecutorService);
- ExecutorServiceParallelExecutor
- .create(
- 2, TransformEvaluatorRegistry.javaSdkNativeRegistry(context,
- PipelineOptionsFactory.create().as(DirectOptions.class)),
emptyMap(),
- context,
- metricsExecutorService)
- .stop();
+ final EvaluationContext context =
+ EvaluationContext.create(
+ MockClock.fromInstant(Instant.now()),
+ CloningBundleFactory.create(),
+ graph,
+ emptySet(),
+ metricsExecutorService);
+ ExecutorServiceParallelExecutor.create(
+ 2,
+ TransformEvaluatorRegistry.javaSdkNativeRegistry(
+ context,
PipelineOptionsFactory.create().as(DirectOptions.class)),
+ emptyMap(),
+ context,
+ metricsExecutorService)
+ .stop();
try {
- metricsExecutorService.awaitTermination(10000L, TimeUnit.MILLISECONDS);
+ metricsExecutorService.awaitTermination(10L, TimeUnit.SECONDS);
} catch (InterruptedException e) {
- e.printStackTrace();
+ Thread.currentThread().interrupt();
+ throw new RuntimeException(e);
}
}
@Test
- public void test() throws Exception {
- pipeline
- .apply(
- // Use maxReadTime to force unbounded mode.
-
GenerateSequence.from(0).to(NUM_ELEMENTS).withMaxReadTime(Duration.standardDays(1)))
- .apply(ParDo.of(new CountingDoFn()));
+ public void testNoThreadsLeakInPipelineExecution() {
+
pipeline.apply(GenerateSequence.from(0).to(NUM_ELEMENTS)).apply(ParDo.of(new
CountingDoFn()));
pipeline.run();
}
@@ -108,7 +108,7 @@ public void processElement(ProcessContext context) {
counter.inc();
context.output(context.element());
} catch (Exception e) {
- e.printStackTrace();
+ throw new RuntimeException(e);
}
}
}
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 99615)
Time Spent: 2.5h (was: 2h 20m)
> ExecutorServiceParallelExecutorTest#ensureMetricsThreadDoesntLeak in PR #4965
> does not pass in gradle
> -----------------------------------------------------------------------------------------------------
>
> Key: BEAM-4088
> URL: https://issues.apache.org/jira/browse/BEAM-4088
> Project: Beam
> Issue Type: Sub-task
> Components: testing
> Reporter: Etienne Chauchot
> Assignee: Etienne Chauchot
> Priority: Major
> Fix For: Not applicable
>
> Time Spent: 2.5h
> Remaining Estimate: 0h
>
> This is a new test being added to ensure threads don't leak. The failure
> seems to indicate that threads do leak.
> This test fails using gradle but previously passed using maven
> PR: https://github.com/apache/beam/pull/4965
> Presubmit Failure:
> * https://builds.apache.org/job/beam_PreCommit_Java_GradleBuild/4059/
> *
> https://scans.gradle.com/s/grha56432j3t2/tests/jqhvlvf72f7pg-ipde5etqqejoa?openStackTraces=WzBd
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)