From issues-return-173570-archive-asf-public=cust-asf.ponee.io@maven.apache.org Mon Oct 5 00:40:02 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mailroute1-lw-us.apache.org (mailroute1-lw-us.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with ESMTPS id 8DF0D180654 for ; Mon, 5 Oct 2020 02:40:02 +0200 (CEST) Received: from mail.apache.org (localhost [127.0.0.1]) by mailroute1-lw-us.apache.org (ASF Mail Server at mailroute1-lw-us.apache.org) with SMTP id B1050121788 for ; Mon, 5 Oct 2020 00:40:01 +0000 (UTC) Received: (qmail 87168 invoked by uid 500); 5 Oct 2020 00:40:01 -0000 Mailing-List: contact issues-help@maven.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@maven.apache.org Delivered-To: mailing list issues@maven.apache.org Received: (qmail 87139 invoked by uid 99); 5 Oct 2020 00:40:01 -0000 Received: from mailrelay1-us-west.apache.org (HELO mailrelay1-us-west.apache.org) (209.188.14.139) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Oct 2020 00:40:01 +0000 Received: from jira2-he-de.apache.org (static.54.33.119.168.clients.your-server.de [168.119.33.54]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 8A3054369D for ; Mon, 5 Oct 2020 00:40:00 +0000 (UTC) Received: from jira2-he-de.apache.org (localhost.localdomain [127.0.0.1]) by jira2-he-de.apache.org (ASF Mail Server at jira2-he-de.apache.org) with ESMTP id 0C7CCC8058B for ; Mon, 5 Oct 2020 00:40:00 +0000 (UTC) Date: Mon, 5 Oct 2020 00:40:00 +0000 (UTC) From: "Adam Jones (Jira)" To: issues@maven.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (SUREFIRE-1851) NPE in SmartStackTraceParser causes false positive test results 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/SUREFIRE-1851?page=3Dcom.atlass= ian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1= 7207795#comment-17207795 ]=20 Adam Jones commented on SUREFIRE-1851: -------------------------------------- PR up at=C2=A0https://github.com/apache/maven-surefire/pull/320 > NPE in SmartStackTraceParser causes false positive test results > --------------------------------------------------------------- > > Key: SUREFIRE-1851 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1851 > Project: Maven Surefire > Issue Type: Bug > Components: Junit 4.x support, JUnit 5.x support, Maven Surefire= Plugin > Reporter: Adam Jones > Priority: Major > Attachments: junit4.11andsurefire2.22.2.txt, junit5.7.0andsurefir= e3.0.0M5.txt > > > If throwing an exception within a test where the stack trace is null, a c= ore utility (SmartStackTraceParser in comon-java5) will throw an NPE. This = will cause the test suite to fail. > What is especially scary about this is that it will not log that the test= has failed, and in some configurations will even declare the build is succ= essful and all tests passed. Additionally, the surefire report plugin will = declare all tests passed too. > An exception with a null stacktrace sounds odd, but is easy to do by mock= ing an exception with frameworks like Mockito. While people probably should= n't be mocking exceptions, it definitely [can and does happen|https://githu= b.com/search?q=3Dmock%28DataIntegrityViolationException.class%29+language%3= AJava+fork%3Afalse&type=3Dcode]. > Not sure what versions exactly are affected. But it's affected the `commo= n-java5` package since 2012. At least both JUnit 4 and 5 are affected, with= surefire 2.22.1 or 3.0.0-M5. Logs attached. > Can be reproduced with=C2=A0https://github.com/domdomegg/surefire-1851-de= mo > I have a patch ready that I believe fixes this. -- This message was sent by Atlassian Jira (v8.3.4#803005)