Return-Path: X-Original-To: apmail-flink-issues-archive@minotaur.apache.org Delivered-To: apmail-flink-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 02CDE18AA0 for ; Thu, 17 Dec 2015 16:29:47 +0000 (UTC) Received: (qmail 15193 invoked by uid 500); 17 Dec 2015 16:29:46 -0000 Delivered-To: apmail-flink-issues-archive@flink.apache.org Received: (qmail 15147 invoked by uid 500); 17 Dec 2015 16:29:46 -0000 Mailing-List: contact issues-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flink.apache.org Delivered-To: mailing list issues@flink.apache.org Received: (qmail 15129 invoked by uid 99); 17 Dec 2015 16:29:46 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Dec 2015 16:29:46 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 967102C0AFA for ; Thu, 17 Dec 2015 16:29:46 +0000 (UTC) Date: Thu, 17 Dec 2015 16:29:46 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@flink.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (FLINK-3166) The first program in ObjectReuseITCase has the wrong expected result, and it succeeds MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/FLINK-3166?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15062276#comment-15062276 ] ASF GitHub Bot commented on FLINK-3166: --------------------------------------- Github user zentol commented on the pull request: https://github.com/apache/flink/pull/1464#issuecomment-165501540 "Object reuse is configured in JavaProgramTestBase but must be set in the ExecutionEnvironmentFactory by TestEnvironment. I don't see that any of the many tests subclassing JavaProgramTestBase were testing with object reuse enabled." Does this (L.112 JavaProgramTestBase) ``` // prepare the test environment TestEnvironment env = new TestEnvironment(this.executor, this.parallelism); env.getConfig().enableObjectReuse(); env.setAsContext(); ``` not enable (and as such force) object reuse for every test that extends JavaProgramTestBase? > The first program in ObjectReuseITCase has the wrong expected result, and it succeeds > ------------------------------------------------------------------------------------- > > Key: FLINK-3166 > URL: https://issues.apache.org/jira/browse/FLINK-3166 > Project: Flink > Issue Type: Bug > Components: Distributed Runtime, Documentation, Tests > Reporter: Gabor Gevay > Assignee: Greg Hogan > Priority: Critical > > The first program in ObjectReuseITCase has the following input: > a,1 > a,2 > a,3 > a,4 > a,50 > There is a groupBy on field 0, and then a reduce, so the result should be 1+2+3+4+50 = 60. But the hardcoded expected result is 100, and running the Flink program also produces this. > The problem is caused my mismatched assumptions between ReduceCombineDriver.sortAndCombine and the ReduceFunction in the test about object reuse rules of ReduceFunctions: > ReduceCombineDriver.sortAndCombine has the following comment: > "The user function is expected to return the first input as the result." > While the ReduceFunction in the test is modifying and returning the second input. (And the second program in the test also has the same problem.) > I can't find the assumption that is stated in the comment in any documentation. For example, the javadoc of ReduceFunction should make the user aware of this. Or, alternatively, the code of the driver should be modified to not make this assumption. I'm not sure which solution is better. -- This message was sent by Atlassian JIRA (v6.3.4#6332)