From issues-return-66421-archive-asf-public=cust-asf.ponee.io@ignite.apache.org Tue Jun 5 12:02:04 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 1FEE0180625 for ; Tue, 5 Jun 2018 12:02:03 +0200 (CEST) Received: (qmail 65555 invoked by uid 500); 5 Jun 2018 10:02:03 -0000 Mailing-List: contact issues-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list issues@ignite.apache.org Received: (qmail 65546 invoked by uid 99); 5 Jun 2018 10:02:03 -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; Tue, 05 Jun 2018 10:02:03 +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 E55E41A2532 for ; Tue, 5 Jun 2018 10:02:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -110.301 X-Spam-Level: X-Spam-Status: No, score=-110.301 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] 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 xO7eS6408ree for ; Tue, 5 Jun 2018 10:02:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id EB68B5F542 for ; Tue, 5 Jun 2018 10:02:00 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 75C1BE00A9 for ; Tue, 5 Jun 2018 10:02:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 3481521094 for ; Tue, 5 Jun 2018 10:02:00 +0000 (UTC) Date: Tue, 5 Jun 2018 10:02:00 +0000 (UTC) From: "Alexey Kuznetsov (JIRA)" To: issues@ignite.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (IGNITE-8570) Create lighter version of GridStringLogger MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/IGNITE-8570?page=3Dcom.atlassi= an.jira.plugin.system.issuetabpanels:all-tabpanel ] Alexey Kuznetsov updated IGNITE-8570: ------------------------------------- Description:=20 Most usages of {{GridStringLogger}} in test assumes the following scenario.= First, it is set as a logger for some Ignite node. Then, after some activi= ty on that node, log content is searched for some predefined strings. {{Gri= dStringLogger}} uses {{StringBuilder}} of bounded size internally to store = log contents, older contents gets dropped on exaustion. Thus, changes that = add more logging may damage some independent tests that use {{GridStringLog= ger}}. The suggestion is to implement and use another test logger conforming to th= ese requirements: * It does not accumulate any logs. * It allows to set the listener that fires when log message matches certain= regular expression, {{Matcher}} can be passed to the listener. Proposed design, pseudocode: ``` Class GridRegexpLogger implements IgniteLogger{ =E2=80=A6 debug(String str){ if(/* str matches pattern. */{ /* notify listeners. */ =09} } =E2=80=A6 listen("regexp", loggerListener){ =09/* registers listener. */ } listenDebug("regexp", loggerListener){ =09/* registers listener for debug output only. */ } =E2=80=A6 waitFor("regexp", timeout){ =09/* like GridTestUtils.waitForCondition(), waits for regexp to occure in = logs. */ } =E2=80=A6 } ``` Sample regexp logger usage: ``` GridRegexpLogger logger; =20 logger.listen(=E2=80=9Cregexp=E2=80=9D, new GridRegexpListener()); logger.waitFor("regexp", 100); ``` was: Most usages of {{GridStringLogger}} in test assumes the following scenario.= First, it is set as a logger for some Ignite node. Then, after some activi= ty on that node, log content is searched for some predefined strings. {{Gri= dStringLogger}} uses {{StringBuilder}} of bounded size internally to store = log contents, older contents gets dropped on exaustion. Thus, changes that = add more logging may damage some independent tests that use {{GridStringLog= ger}}. The suggestion is to implement and use another test logger conforming to th= ese requirements: * It does not accumulate any logs. * It allows to set the listener that fires when log message matches certain= regular expression, {{Matcher}} can be passed to the listener. > Create lighter version of GridStringLogger > ------------------------------------------ > > Key: IGNITE-8570 > URL: https://issues.apache.org/jira/browse/IGNITE-8570 > Project: Ignite > Issue Type: Improvement > Affects Versions: 2.4 > Reporter: Andrey Kuznetsov > Assignee: Alexey Kuznetsov > Priority: Major > Fix For: 2.6 > > > Most usages of {{GridStringLogger}} in test assumes the following scenari= o. First, it is set as a logger for some Ignite node. Then, after some acti= vity on that node, log content is searched for some predefined strings. {{G= ridStringLogger}} uses {{StringBuilder}} of bounded size internally to stor= e log contents, older contents gets dropped on exaustion. Thus, changes tha= t add more logging may damage some independent tests that use {{GridStringL= ogger}}. > The suggestion is to implement and use another test logger conforming to = these requirements: > * It does not accumulate any logs. > * It allows to set the listener that fires when log message matches certa= in regular expression, {{Matcher}} can be passed to the listener. > Proposed design, pseudocode: > ``` > Class GridRegexpLogger implements IgniteLogger{ > =E2=80=A6 > debug(String str){ > if(/* str matches pattern. */{ > /* notify listeners. */ > =09} > } > =E2=80=A6 > listen("regexp", loggerListener){ > =09/* registers listener. */ > } > listenDebug("regexp", loggerListener){ > =09/* registers listener for debug output only. */ > } > =E2=80=A6 > waitFor("regexp", timeout){ > =09/* like GridTestUtils.waitForCondition(), waits for regexp to occure i= n logs. */ > } > =E2=80=A6 > } > ``` > Sample regexp logger usage: > ``` > GridRegexpLogger logger; > =20 > logger.listen(=E2=80=9Cregexp=E2=80=9D, new GridRegexpListener()); > logger.waitFor("regexp", 100); > ``` -- This message was sent by Atlassian JIRA (v7.6.3#76005)