From dev-return-29774-archive-asf-public=cust-asf.ponee.io@geode.apache.org Fri Sep 21 19:43:43 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 BE108180656 for ; Fri, 21 Sep 2018 19:43:42 +0200 (CEST) Received: (qmail 8434 invoked by uid 500); 21 Sep 2018 17:43:41 -0000 Mailing-List: contact dev-help@geode.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@geode.apache.org Delivered-To: mailing list dev@geode.apache.org Received: (qmail 8423 invoked by uid 99); 21 Sep 2018 17:43:41 -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; Fri, 21 Sep 2018 17:43:41 +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 C12BF1A12BD for ; Fri, 21 Sep 2018 17:43:40 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.701 X-Spam-Level: X-Spam-Status: No, score=-0.701 tagged_above=-999 required=6.31 tests=[RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id J-H7cDs-mIBX for ; Fri, 21 Sep 2018 17:43:39 +0000 (UTC) Received: from mx0a-00296801.pphosted.com (mx0a-00296801.pphosted.com [148.163.150.38]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 36C8E5F41A for ; Fri, 21 Sep 2018 17:43:39 +0000 (UTC) Received: from pps.filterd (m0114581.ppops.net [127.0.0.1]) by mx0a-00296801.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w8LHegfH005840 for ; Fri, 21 Sep 2018 17:43:38 GMT Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by mx0a-00296801.pphosted.com with ESMTP id 2mmkjf0qcs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Fri, 21 Sep 2018 17:43:38 +0000 Received: by mail-pl1-f199.google.com with SMTP id k18-v6so6398397pls.12 for ; Fri, 21 Sep 2018 10:43:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:content-transfer-encoding:mime-version:date :subject:message-id:references:in-reply-to:to; bh=t8f+rxpEi4q6wQQQjWQb/4vh9GYPQrb5/iicyH6CtAg=; b=mP8lWIJUhc2SUXNT+HFmCgvh8RbYxFwX2uOt4XJ2te9DVtB2OV7A9mUIRag2MHqd6h XFqa5xiN5gnQe9wgZMgR9Txvd9XHI1RoNLWrTNtRmvFF2hxspk3jnc5x/78ttaahjNRE 2g5UkUuOidoCoBeATW8ErpO7+UlCgX68yr9xrCG9CaucxFFsIBiSMxKr64P9uatm2ND9 X4cLdk6VKFvqCIqir+gjRm8rXbpg7F5xpGrwXA9dLtAxpsXEm5xrjrOHMFvv5PPU7RB/ Po3EuuOXln1N3AGxYL+4RRhZiiUYr0s3mCYbttMdwm6L5EF2tXcog5W7cCqOdYD0xiKa BV3A== X-Gm-Message-State: APzg51ClIK03P6Blj+2kQ79WIgbtUhiObARi1tIXULTF6kqyEw5quL4U gAGn4bz6wmbrTQgbKMf9PJR2GJSALuEzBfNMDUtqB7ENDIYBPEi5I1+5GsNs1pzwd3lcgLC9oXt 9VdJH9xHJL7fY4g1M7JQWwDwmQ5/ng3FDW18+AN8= X-Received: by 2002:a17:902:9307:: with SMTP id bc7-v6mr44850266plb.225.1537551817010; Fri, 21 Sep 2018 10:43:37 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYmUqpJgfcWluGV70dUI2cN6DSCbKnxnwhoG/AJTzH49fAWfhpGeLcmbeZbUniEUbCNhKYtzQ== X-Received: by 2002:a17:902:9307:: with SMTP id bc7-v6mr44850245plb.225.1537551816591; Fri, 21 Sep 2018 10:43:36 -0700 (PDT) Received: from ?IPv6:2600:2100:7:8000:e43f:a625:54ca:801c? ([2600:2100:7:8000:e43f:a625:54ca:801c]) by smtp.gmail.com with ESMTPSA id r19-v6sm46596089pgg.39.2018.09.21.10.43.36 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 21 Sep 2018 10:43:36 -0700 (PDT) From: Jacob Barrett Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (1.0) Date: Fri, 21 Sep 2018 10:43:35 -0700 Subject: Re: [DISCUSS] test code style (particularly logging) Message-Id: <6EA7A6EB-5EC9-4619-8414-C78C0A5383F0@pivotal.io> References: In-Reply-To: To: dev@geode.apache.org X-Mailer: iPhone Mail (16A366) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-09-21_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=605 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1809210173 Exactly what Kirk said! > On Sep 21, 2018, at 10:34 AM, Kirk Lund wrote: >=20 > Most of these logWriter or logger usages are in larger end-to-end tests > that were written before we could using IDE debuggers on our tests. With a= > debugger, I don't want to see more output from the test so I tend to delet= e > all such System.out.printlns or LogWriter/Logger usage. >=20 > My recommendation is to delete all extra System.out.printlns AND > LogWriter/Logger usages unless it's part of the test itself. If you think > the line is useful, then would it be sufficient as a comment? If not then > maybe the test is too long, doing too much and should be exploded into > several easier to debug test methods with more narrow focus. >=20 > Remember, a single test that does a lot and has tons of assertions is an > anti-pattern. It's better to split that test out into many tests such that= > by seeing that the test failed, you either know exactly what broke without= > digging too much or at least have a pretty good idea where to dig. Sure, > there's a balance to strike especially in end-to-end tests but if the test= > method scrolls along for many screens, then most likely it's doing too muc= h > and the author(s) added logging to compensate for this. >=20 > On Thu, Sep 20, 2018 at 2:10 PM, Darrel Schneider > wrote: >=20 >> For simple single threaded tests System.out would do the job. >> For a multi-threaded test I have found the logging framework to be helpfu= l >> because of the thread id and the timestamps. >>=20 >>=20 >>> On Thu, Sep 20, 2018 at 1:50 PM Dale Emery wrote: >>>=20 >>> As long as the stdout is available in the test results, I=E2=80=99m more= than >>> happy to avoid coupling the tests to the product logging code. >>>=20 >>>> On Sep 20, 2018, at 1:39 PM, Galen O'Sullivan >>> wrote: >>>>=20 >>>> I was reviewing a PR recently and noticed that we have some test code >>> that >>>> uses Logger (or LogWriter). If I understand correctly, anything logged >> to >>>> stdout will be included in the test output, and anything logged in a >>> DUnit >>>> VM will be logged with the appropriate VM number prepended in the >> output. >>>> Because logging is coupled to product code, I propose we log all test >>>> output to standard out (using System.out.println or such). I also >> propose >>>> we add this to the Geode style guide. >>>>=20 >>>> Thoughts/questions/objections? >>>>=20 >>>> Thanks, >>>> Galen >>>=20 >>>=20 >>> =E2=80=94 >>> Dale Emery >>> demery@pivotal.io >>>=20 >>>=20 >>=20