From dev-return-35628-archive-asf-public=cust-asf.ponee.io@sqoop.apache.org Wed Feb 14 18:18:31 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 0B43F180621 for ; Wed, 14 Feb 2018 18:18:30 +0100 (CET) Received: (qmail 77166 invoked by uid 500); 14 Feb 2018 17:18:30 -0000 Mailing-List: contact dev-help@sqoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@sqoop.apache.org Delivered-To: mailing list dev@sqoop.apache.org Received: (qmail 77151 invoked by uid 500); 14 Feb 2018 17:18:29 -0000 Delivered-To: apmail-incubator-sqoop-dev@incubator.apache.org Received: (qmail 77148 invoked by uid 99); 14 Feb 2018 17:18:29 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Feb 2018 17:18:29 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id DD80F1A0719; Wed, 14 Feb 2018 17:18:28 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.69 X-Spam-Level: X-Spam-Status: No, score=0.69 tagged_above=-999 required=6.31 tests=[HTML_MESSAGE=2, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_MED=-2.3, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id 43TsTDwPNaTP; Wed, 14 Feb 2018 17:18:27 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id C763B5F187; Wed, 14 Feb 2018 17:18:26 +0000 (UTC) Received: from reviews.apache.org (unknown [10.41.0.12]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 1A069E00D5; Wed, 14 Feb 2018 17:18:26 +0000 (UTC) Received: from reviews-vm2.apache.org (localhost [IPv6:::1]) by reviews.apache.org (ASF Mail Server at reviews-vm2.apache.org) with ESMTP id 652F8C40017; Wed, 14 Feb 2018 17:18:24 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============7839566898741609960==" MIME-Version: 1.0 Subject: Re: Review Request 65530: MySQL thirdparty tests hang if there's no USER environment variable From: Attila Szabo To: daniel voros , Attila Szabo , Sqoop Date: Wed, 14 Feb 2018 17:18:24 -0000 Message-ID: <20180214171824.60661.9312@reviews-vm2.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: Attila Szabo X-ReviewGroup: Sqoop X-Auto-Response-Suppress: DR, RN, OOF, AutoReply X-ReviewRequest-URL: https://reviews.apache.org/r/65530/ X-Sender: Attila Szabo X-ReviewBoard-ShipIt: 1 References: <20180206121508.26815.80634@reviews-vm2.apache.org> In-Reply-To: <20180206121508.26815.80634@reviews-vm2.apache.org> Reply-To: Attila Szabo X-ReviewRequest-Repository: sqoop-trunk --===============7839566898741609960== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/65530/#review197565 ----------------------------------------------------------- Ship it! Nice and clean solution, and a very nice catch in the test codebase! GJ! - Attila Szabo On Feb. 6, 2018, 12:15 p.m., daniel voros wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/65530/ > ----------------------------------------------------------- > > (Updated Feb. 6, 2018, 12:15 p.m.) > > > Review request for Sqoop. > > > Bugs: SQOOP-3283 > https://issues.apache.org/jira/browse/SQOOP-3283 > > > Repository: sqoop-trunk > > > Description > ------- > > `org.apache.sqoop.manager.mysql.MySQLTestUtils#getCurrentUser()` executes `whoami` in a subprocess if there's no USER environment variable (happened to me while running tests from Docker). However, it waits for the Process variable to become null, that never happens: > > ``` > // wait for whoami to exit. > while (p != null) { > try { > int ret = p.waitFor(); > if (0 != ret) { > LOG.error("whoami exited with error status " + ret); > // suppress original return value from this method. > return null; > } > } catch (InterruptedException ie) { > continue; // loop around. > } > } > ``` > > We could get rid of the while loop since `Process#waitFor()` blocks while it completes. > > Note, that it's easy to workaround the issue by setting the USER environment variable when running the tests. > > > Diffs > ----- > > src/test/org/apache/sqoop/manager/mysql/MySQLTestUtils.java 25dbe9d > > > Diff: https://reviews.apache.org/r/65530/diff/2/ > > > Testing > ------- > > Run `org.apache.sqoop.manager.mysql.MySQLCompatTest`. Failed with timout without the patch. All 46 test cases pass in ~45 seconds with the patch in place. > > > Thanks, > > daniel voros > > --===============7839566898741609960==--