From issues-return-100205-apmail-maven-issues-archive=maven.apache.org@maven.apache.org Sat Jan 31 20:01:13 2015 Return-Path: X-Original-To: apmail-maven-issues-archive@minotaur.apache.org Delivered-To: apmail-maven-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 422BC1776B for ; Sat, 31 Jan 2015 20:01:13 +0000 (UTC) Received: (qmail 18830 invoked by uid 500); 31 Jan 2015 20:01:13 -0000 Delivered-To: apmail-maven-issues-archive@maven.apache.org Received: (qmail 18769 invoked by uid 500); 31 Jan 2015 20:01:13 -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 18758 invoked by uid 99); 31 Jan 2015 20:01:13 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 31 Jan 2015 20:01:13 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [199.193.192.100] (HELO codehaus01.managed.contegix.com) (199.193.192.100) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 31 Jan 2015 20:01:08 +0000 Received: from codehaus01 (localhost.localdomain [127.0.0.1]) by codehaus01.managed.contegix.com (Postfix) with ESMTP id 632CEB1167 for ; Sat, 31 Jan 2015 14:00:18 -0600 (CST) Date: Sat, 31 Jan 2015 14:00:18 -0600 (CST) From: "Andreas Gudian (JIRA)" To: issues@maven.apache.org Message-ID: In-Reply-To: References: Subject: [jira] (SUREFIRE-1138) Enabling reuseForks runs all tests in series on just one fork MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 22cf62d5d84cf5bea94eb3b65e0ebd09 X-Virus-Checked: Checked by ClamAV on apache.org [ https://jira.codehaus.org/browse/SUREFIRE-1138?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=362163#comment-362163 ] Andreas Gudian commented on SUREFIRE-1138: ------------------------------------------ OK, I found out how the problem was introduced in 2.18. Fortunately, only the JUnit4 provider is affected. You can easily work-around the issue by using the more modern provider implementation for JUnit 4.7+ by adding this to your pom: {code} org.apache.maven.plugins maven-surefire-plugin 2.18.1 org.apache.maven.surefire surefire-junit47 2.18.1 {code} @[~tibor17], the issue was introduced in commit 4df65165717126c88569e1fa62b0ea30559cbfa3, which eagerly iterates over TestsToRun in JUnit4Provider.createTestsDescription(). Can you remember why that might be necessary? Could you please take a look? If you see a quick way to fix it, feel free to grab the issue - otherwise let me know and I'll try it myself... :) > Enabling reuseForks runs all tests in series on just one fork > ------------------------------------------------------------- > > Key: SUREFIRE-1138 > URL: https://jira.codehaus.org/browse/SUREFIRE-1138 > Project: Maven Surefire > Issue Type: Bug > Components: Maven Surefire Plugin > Affects Versions: 2.18, 2.18.1 > Environment: Apache Maven 3.0.4 (r1232337; 2012-01-17 19:44:56+1100) > Java version: 1.7.0_17, vendor: Oracle Corporation > Ubuntu 12.04 LTS > Reporter: Matthew Provis > Assignee: Andreas Gudian > Attachments: test.zip > > > When using Surefire >= 2.18, I've encountered a problem when setting {{forkCount > 1}} and {{reuseForks = true}}. > Expected behaviour: > Tests should run simultaneously, each on a separate fork. > Actual behaviour: > All tests run on just one fork, sequentially. > Setting {{reuseForks = false}} gives the expected behaviour. > Reverting to Surefire 2.17 also gives the expected behaviour. > I've attached a project that demonstrates the issue. Here I've created two tests, each of which prints the fork number and sleeps for 5 seconds. The total run time is 10 seconds with Surefire 2.18 and 2.18.1, but 5 seconds with version 2.17. -- This message was sent by Atlassian JIRA (v6.1.6#6162)