[
https://issues.apache.org/jira/browse/BEAM-4088?focusedWorklogId=98182&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-98182
]
ASF GitHub Bot logged work on BEAM-4088:
----------------------------------------
Author: ASF GitHub Bot
Created on: 04/May/18 10:18
Start Date: 04/May/18 10:18
Worklog Time Spent: 10m
Work Description: echauchot closed pull request #5267: [BEAM-4088] Wait
until the test thread is properly terminated (and no timeout has elapsed) to
check the leaks. Set a timeout on the junit test itself
URL: https://github.com/apache/beam/pull/5267
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..e3988050d2f 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
@@ -58,7 +58,8 @@
@Rule
public final TestName testName = new TestName();
- @Test
+ // sets a timeout to avoid infinite waiting for threads termination
+ @Test(timeout = 600_000L)
public void ensureMetricsThreadDoesntLeak() {
final DirectGraph graph = DirectGraph.create(
emptyMap(), emptyMap(), LinkedListMultimap.create(),
@@ -83,7 +84,11 @@ public void ensureMetricsThreadDoesntLeak() {
metricsExecutorService)
.stop();
try {
- metricsExecutorService.awaitTermination(10000L, TimeUnit.MILLISECONDS);
+ // waits until the threads are properly terminated. If the timeout
elapsed, then keep waiting
+ boolean timerElapsed = false;
+ while (!timerElapsed){
+ timerElapsed = metricsExecutorService.awaitTermination(1L,
TimeUnit.MINUTES);
+ }
} catch (InterruptedException e) {
e.printStackTrace();
}
----------------------------------------------------------------
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: 98182)
Time Spent: 1h 10m (was: 1h)
> 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: 1h 10m
> 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)