You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Tibor Digana (JIRA)" <ji...@apache.org> on 2016/09/19 07:38:21 UTC

[jira] [Comment Edited] (SUREFIRE-1245) Unable to run TestNG tests using maven surefire plugin.

    [ https://issues.apache.org/jira/browse/SUREFIRE-1245?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15502598#comment-15502598 ] 

Tibor Digana edited comment on SUREFIRE-1245 at 9/19/16 7:37 AM:
-----------------------------------------------------------------

I am really not able to find root cause why these tests hang. I am more convinced about Selenium timeout issues as I wrote above or problem that somebody overrides std/out via {{java.lang.System.setOut(...)}}.
You wrote that:
>>I ran in 2.18 and 2.17 and I am facing the same issue.
This is different from my previous experiences of Surefire running at Mac. Other users reported that Surefire 2.19 at Mac hangs but it does not hang in 2.18.x. This was fixed in 2.19.1. We found only some differences between x86_64 and Mac that the GC is different, delays and race conditions change and CPU cache coherence is different. So I used locks without performance enhancements and this was the fix.

Now this issue is different because it does not have these symptoms that 2.18.x does not hang. Here every version of Surefire hangs.
In other bugs there was reason why it hangs, because ping feature was introduced and bi-directional communication between maven process and forked surefire processes.


was (Author: tibor17):
I am really not able to find root cause why these tests hang. I am more convinced about Selenium timeout issues as I wrote above or problem that somebody overrides std/out via {{java.lang.System.setOut(...)}}.
You wrote that:
>>I ran in 2.18 and 2.17 and I am facing the same issue.
This is different from my previous experiences of Surefire running at Mac. Other users reported that Surefire 2.19 at Mac hangs but it does not hang in 2.18.x. This was fixed in 2.19.1. We found only one difference between x86_64 and Mac that the GC is different, delays and race conditions change and CPU cache coherence is different. So I used locks without performance enhancements and this was the fix.

Now this issue is different because it does not have these symptoms that 2.18.x does not hang. Here every version of Surefire hangs.
In other bugs there was reason why it hangs, because ping feature was introduced and bi-directional communication between maven process and forked surefire processes.

> Unable to run TestNG tests using maven surefire plugin.
> -------------------------------------------------------
>
>                 Key: SUREFIRE-1245
>                 URL: https://issues.apache.org/jira/browse/SUREFIRE-1245
>             Project: Maven Surefire
>          Issue Type: Bug
>            Reporter: Hemanth
>            Assignee: Tibor Digana
>            Priority: Blocker
>         Attachments: pom.xml, testng.xml
>
>
> I am having testng.xml with around 8 classes. The suite will be running fine but suddenly stops working and gives me unreachable browser exception. The same tests finishes off its execution using failsafe plugin like a charm, but my reporting tool is kind of dependent on the surefire plugin. Running it by testng.xml(Right clicking and clicking on run as testng suite is working fine as well). If there is any mistake that I have done in the pom.xml please help me out as well. Please look into this issue.
> Here is a testng.xml
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
> <suite name="EtnaTestSuite">
>  <listeners>
>         <listener class-name="org.etna.maincontroller.MainController"/>
>         <listener class-name="org.etna.utils.ReportGenerator"/>
>     </listeners>
>   <test name="EtnaTestAutomation">
>     <classes>
>     <class name="org.etna.modules.ShopByModuleTest"/>
>     <class name="org.etna.modules.APAModuleTest"/>
>     <class name="org.etna.modules.ProductListModuleTest"/>
>     <class name="org.etna.modules.LoginModuleTest"/>
>     <class name="org.etna.modules.MyCartModuleTest"/>
>     <class name="org.etna.modules.CategoryModuleTest"/>
>     <class name="org.etna.modules.ProductDetailsModuleTest"/>
>     <class name="org.etna.modules.SearchModuleTest"/>
>     <class name="org.etna.modules.HomePageModuleTest"/>
>    </classes> 
>   </test> <!-- Test -->
> </suite> <!-- Suite -->
>  <!--  -->
> Here is my pom.xml
> <?xml version="1.0" encoding="UTF-8"?>
> <project xmlns="http://maven.apache.org/POM/4.0.0"
>          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
>     <modelVersion>4.0.0</modelVersion>
>     
>     <groupId>ETNA</groupId>
>     <artifactId>inhouse.NewStandardEcommerceTemplate</artifactId>
>     <version>1.0-SNAPSHOT</version>
>     <properties>
>     	<compiler.version>1.8</compiler.version>
>         <allure.version>1.5.0.RC2</allure.version>
>         <aspectj.version>1.8.5</aspectj.version>
>         <version.selenium>2.53.0</version.selenium>
>          <version.slf4j>1.7.7</version.slf4j>
>     </properties>
>     <name>ETNA</name>
>     <description>New standard ecommerce template</description>
>     <dependencies>
> 	 <dependency>
>     <groupId>com.fasterxml.jackson.core</groupId>
>     <artifactId>jackson-databind</artifactId>
>     <version>2.7.0</version>
>   </dependency>
>     
>     <dependency>
> 	<groupId>com.pojosontheweb</groupId>
> 	<artifactId>monte-repack</artifactId>
> 	<version>1.0</version>
> 	</dependency>
>     <dependency>
>   <groupId>org.testng</groupId>
>   <artifactId>testng</artifactId>
>   <version>6.9.10</version>
>   <scope>test</scope>
> </dependency>
>     
>     
>     <dependency>
> 	<groupId>com.jayway.restassured</groupId>
> 	<artifactId>rest-assured</artifactId>
> 	<version>2.9.0</version>
> 	</dependency>
>     <dependency>
>         <groupId>org.seleniumhq.selenium</groupId>
>         <artifactId>selenium-firefox-driver</artifactId>
>         <version>${version.selenium}</version>
>     </dependency>
>     
>  <!-- custom excelread library using apachePOI -->   
>     <dependency>
> 	<groupId>org.apache.poi</groupId>
> 	<artifactId>poi</artifactId>
> 	<version>3.13</version>
> </dependency>
>     
>     <dependency>
>     <groupId>org.apache.poi</groupId>
>     <artifactId>poi-ooxml</artifactId>
>     <version>3.13</version>
> </dependency>
> <dependency>
> 	<groupId>org.apache.poi</groupId>
> 	<artifactId>poi-ooxml-schemas</artifactId>
> 	<version>3.13</version>
> </dependency>
> <!-- zipturnaround -->
> 	<dependency>
> 	<groupId>org.zeroturnaround</groupId>
> 	<artifactId>zt-zip</artifactId>
> 	<version>1.7</version>
> 	</dependency>
>  <!-- java mail -->
>     <dependency>
> 	<groupId>javax.mail</groupId>
> 	<artifactId>mail</artifactId>
> 	<version>1.4.7</version>
> </dependency>
>             
>         <!-- Selenium and Drivers -->
>         <dependency>
>             <groupId>org.seleniumhq.selenium</groupId>
>             <artifactId>selenium-java</artifactId>
>             <version>${version.selenium}</version>
>             <scope>test</scope>
>         </dependency>
>         
>         <dependency>
> 	<groupId>org.seleniumhq.selenium</groupId>
> 	<artifactId>selenium-server</artifactId>
> 	<version>${version.selenium}</version>
> </dependency>
>         
>         
>         <dependency>
>             <groupId>ru.yandex.qatools.allure</groupId>
>             <artifactId>allure-testng-adaptor</artifactId>
>             <version>${allure.version}</version>
>             <exclusions>
>                 <exclusion>
>                     <groupId>junit</groupId>
>                     <artifactId>junit</artifactId>
>                 </exclusion>
>             </exclusions>
>         </dependency>
>  
>         <dependency>
>             <groupId>org.hamcrest</groupId>
>             <artifactId>hamcrest-all</artifactId>
>             <version>1.3</version>
>         </dependency>
>         
>          <dependency>
> 	<groupId>com.google.code.gson</groupId>
> 	<artifactId>gson</artifactId>
> 	<version>2.3.1</version>
> 	</dependency>
> 	
> 	 <dependency>
>             <groupId>org.slf4j</groupId>
>             <artifactId>slf4j-api</artifactId>
>             <version>${version.slf4j}</version>
>             <scope>test</scope>
>         </dependency>
>         
>         <dependency>
>             <groupId>org.slf4j</groupId>
>             <artifactId>slf4j-log4j12</artifactId>
>             <version>${version.slf4j}</version>
>             <scope>test</scope>
>         </dependency>
>         
>         <dependency>
>             <groupId>org.slf4j</groupId>
>             <artifactId>jul-to-slf4j</artifactId>
>             <version>${version.slf4j}</version>
>             <scope>test</scope>
>         </dependency>
>         
>         <dependency>
>             <groupId>org.slf4j</groupId>
>             <artifactId>jcl-over-slf4j</artifactId>
>             <version>${version.slf4j}</version>
>             <scope>test</scope>
>         </dependency>
>         
>     </dependencies>
>     <build>
>         <plugins>
>         	
>         	<plugin>
>                 <groupId>org.apache.maven.plugins</groupId>
>                 <artifactId>maven-compiler-plugin</artifactId>
>                 <version>3.1</version>
>                 <configuration>
>                     <source>${compiler.version}</source>
>                     <target>${compiler.version}</target>
>                 </configuration>
>             </plugin>
>             	
>             <plugin>
>                 <groupId>org.apache.maven.plugins</groupId>
>                 <artifactId>maven-surefire-plugin</artifactId>
>                 <version>2.19.1</version>
>                 <configuration>
>                   <suiteXmlFiles>
>            		 <suiteXmlFile>testng.xml</suiteXmlFile>
>          		 </suiteXmlFiles>
>                     <argLine>
>                         -javaagent:${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar
>                     </argLine>
>                 </configuration>
>                 <dependencies>
>                     <dependency>
>                         <groupId>org.aspectj</groupId>
>                         <artifactId>aspectjweaver</artifactId>
>                         <version>${aspectj.version}</version>
>                     </dependency>
>                 </dependencies>
>             </plugin>
>             <!--Needed only to show reports locally. Run jetty:run and
>             open localhost:8080 to show the report-->
>             <plugin>
>                 <groupId>org.eclipse.jetty</groupId>
>                 <artifactId>jetty-maven-plugin</artifactId>
>                 <version>9.2.10.v20150310</version>
>                 <configuration>
>                     <webAppSourceDirectory>${project.build.directory}/site/allure-maven-plugin</webAppSourceDirectory>
>                     <stopKey>stop</stopKey>
>                     <stopPort>1234</stopPort>
>                 </configuration>
>             </plugin>
>         </plugins>
>     </build>
>     <reporting>
>         <excludeDefaults>true</excludeDefaults>
>         <plugins>
>             <plugin>
>                 <groupId>ru.yandex.qatools.allure</groupId>
>                 <artifactId>allure-maven-plugin</artifactId>
>                 <version>2.5</version>
>                   <configuration>
>                     <reportVersion>${allure.version}</reportVersion>
>                 </configuration>
>             </plugin>
>         </plugins>
>     </reporting>
> </project>



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)