ingwarsw / arquillian-suite-extension

Arquillian extension that will force single deployment for all tests
Apache License 2.0
67 stars 20 forks source link

Undeploy does not work on Wildfly #27

Closed wpongra closed 7 years ago

wpongra commented 9 years ago

Hi, I am encountering a problem with the extension suite on wildfly - the connection to the server is lost before undeploy, and therefore the deployment stays on the server.

I created a small example project: https://github.com/wpongra/ARQ-Ext-Bug-Demo It assumes a running wildfly with default configuration. Call mvn verify - it will work once, but not twice because the deployment stays on the server. The issue has already been created once - here: https://github.com/ingwarsw/arquillian-suite-extension/issues/13

Error message on the server AFTER last test is executed:

14:23:50,309 ERROR [org.jboss.remoting.remote.connection] (XNIO-1 I/O-1) JBREM000200: Remote connection failed: java.io.IOException: Eine vorhandene Verbindung wurde vom Remotehost geschlossen

HINT: This error message is also present when arquillian extension suite is NOT USED AT ALL - meaning it is most likely an XNIO-Bug. What I assume is happening is: The connection is closed after the last test is run but BEFORE the extension suite dues its undeploy.

It is most likely not directly related to the extension suite - but as it only occurs with this suite, maybe someone knows a workaround. Nobody else on the internet seems to care about this issue anyway.

I have fixed it for my project by not blocking the last regular undeploy - but I am not sure if this is a good way for all projects ...

wpongra commented 9 years ago

I found out it works with testng without any problem. This kind of confirms that the problem is the arquillian junit wildfly adapter - it does not execute BeforeStop before killing the wildfly connection.

I saw that there is also a bug with gradle concerning basically the BeforeStop. A wild idea would be not to use the BeforeStop behavior at all - but different events to find out when the last test has been executed.

One approuch would be to count the classes which inherit from the Deployments-Class - although a primitive approach, it works for me in a productive project.

wpongra commented 9 years ago

Turns out it is a bug in the suite after all - the following artifact does the same and works

org.rhq rhq-arquillian-suite-extension 4.13.0
cschuch commented 9 years ago

@wpongra - I'm running into the same issue with jboss 7... did you find any documentation online for the other extension you found? I tried googling around a bit and couldn't find much.

wpongra commented 9 years ago

@cschuch No, there is not much. There is this page (https://gist.github.com/aslakknutsen/3975179) which has about the same source code and there is some discussion about it.

But on the other hand - it is just one java class, so even looking at the source code is enough. In short it does the same as this extension - the difference is that the class containing the deployment(s) is found by a tag in arquillian.xml

<?xml version="1.0" encoding="UTF-8"?>
<arquillian xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://jboss.org/schema/arquillian" xsi:schemaLocation="http://jboss.org/schema/arquillian
                         http://jboss.org/schema/arquillian/arquillian_1_0.xsd">

    <defaultProtocol type="Servlet 3.0"/>

    <extension qualifier="suite">
        <property name="deploymentClass">org.jboss.arquillian.extension.suite.Deployments</property>
    </extension>
</arquillian>

Having multiple deployments still work and - just by judging from the code - I would say pretty much everything else that ingwars suite does the other one also does.

phlbrz commented 9 years ago

Try to Overwrite arquillian and shrinkwrap with that (order of import are important):

 <!-- Override dependency resolver with latest version. This must go *BEFORE* the Arquillian BOM. -->

    <dependency>
        <groupId>org.jboss.shrinkwrap.resolver</groupId>
        <artifactId>shrinkwrap-resolver-bom</artifactId>
        <version>2.1.1</version>
    <scope>import</scope>
        <type>pom</type>
    </dependency>
    <dependency>
        <groupId>org.jboss.arquillian</groupId>
    <artifactId>arquillian-bom</artifactId>
    <version>1.1.8.Final</version>
    <type>pom</type>
    <scope>import</scope>
    </dependency>
    <dependency>
        <groupId>org.wildfly.bom</groupId>
        <artifactId>jboss-javaee-7.0-with-all</artifactId>
        <version>8.2.0.Final</version>
        <type>pom</type>
        <scope>import</scope>
    </dependency>
hoeppy commented 9 years ago

@felipecalmeida Sorry I have tested this with following config Wildfly 8.2.0 Final Gradle 2.2.1 junit:junit:4.12 org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-bom:2.1.1 org.jboss.arquillian:arquillian-bom:1.1.8.Final org.jboss.arquillian.junit:arquillian-junit-container:1.1.8.Final org.wildfly:wildfly-spec-api:8.2.0.Final org.jboss.arquillian.protocol:arquillian-protocol-servlet:1.1.8.Final org.jboss.arquillian.extension:arquillian-jacoco:1.0.0.Alpha8 org.jboss.arquillian.extension:arquillian-transaction-bom:1.0.1.Final org.jboss.arquillian.extension:arquillian-persistence-* :1.0.0Alpha7

org.eu.ingwar.tools", name:"arquillian-suite-extension", version:"1.1.2

but no undeploy was performed :(

(tested adapter: org.wildfly.arquillian:wildfly-arquillian-container-managed:1.0.0.Final and org.wildfly:wildfly-arquillian-container-managed:8.2.0.Final)

wpongra commented 9 years ago

@hoeppy I did not test the config of @felipecalmeida - but you might face a separate issue which has to do with gradle: https://github.com/ingwarsw/arquillian-suite-extension/issues/21

dasteg commented 8 years ago

i had the same issue. After doing a deep analysis of the issue i found out that maven-surefire plugin is responsible for this.

We use WildFly 8.2.1 - and only have maven-surefire-plugin 2.18.1 as resolved dependency. When i use this setup i always get the "remote connection failed" error before undeploying the artifact.

I manually added a dependency to the maven-surefire-plugin 2.12.4 - this solved the issue.