Bug 1123901

Summary: [QE] (6.3.1) WebsocketTestCase doesn't do correct cleanup
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Pavel Jelinek <pjelinek>
Component: TestsuiteAssignee: Radim Hatlapatka <rhatlapa>
Status: CLOSED CURRENTRELEASE QA Contact: Pavel Jelinek <pjelinek>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.3.0CC: bbaranow, cdewolf, hmlnarik, jason.greene, jawilson, jcacek, myarboro, olukas, ozizka, pkremens, rhatlapa
Target Milestone: CR1Keywords: Triaged
Target Release: EAP 6.3.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1111137 Environment:
Last Closed: 2014-10-13 18:39:59 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1111137, 1119147    
Bug Blocks: 1102082    

Description Pavel Jelinek 2014-07-28 15:13:38 UTC
+++ This bug was initially created as a clone of Bug #1111137 +++

Some tests from manualmode (e.g. from org.jboss.as.test.manualmode.web.websocket.WebsocketTestCase.websocketTest, org.jboss.as.test.manualmode.security.OutboundLdapConnectionTestCase and org.jboss.as.test.manualmode.logging.CustomFormattersTestCase) fail with AccessControlException when running with Security Manager. It happens only with OpenJDK 7. It is probably related to set enviromenent because this issue occures only on Jenkins and I wasn't able to reproduce it locally.

https://jenkins.mw.lab.eng.bos.redhat.com/hudson/view/EAP6/view/EAP6-security-manager/job/eap-60-as-testsuite-RHEL-matrix-openJDK7-SM/30/jdk=openjdk-1.7.0-local,label_exp=RHEL6%26%26x86/#showFailuresLink

Stacktrace:
ERROR [org.apache.catalina.connector] (http-/10.16.180.35:8080-6) JBWEB001018: An exception or error occurred in the container during the request processing: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "setContextClassLoader")
	at java.security.AccessControlContext.checkPermission(AccessControlContext.java:372) [rt.jar:1.7.0_55]
	at java.security.AccessController.checkPermission(AccessController.java:559) [rt.jar:1.7.0_55]
	at java.lang.SecurityManager.checkPermission(SecurityManager.java:549) [rt.jar:1.7.0_55]
	at java.lang.Thread.setContextClassLoader(Thread.java:1503) [rt.jar:1.7.0_55]
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:114)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:344)
	at org.apache.coyote.http11.Http11NioProcessor.process(Http11NioProcessor.java:353)
	at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:911)
	at org.apache.tomcat.util.net.NioEndpoint$ChannelProcessor.run(NioEndpoint.java:932)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_55]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_55]
	at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_55]

--- Additional comment from Josef Cacek on 2014-07-23 10:42:31 EDT ---

Updating status. This's still an issue in 6.3.0.ER10.

There are actually 2 problems here:

1) WebsocketTestCase tests Http11NioProtocol, which has a doPrivileged() related issue. This is covered by bug #1119147.

2) The WebsocketTestCase doesn't do correct cleanup so the tests which run after this one also use Http11NioProtocol (and they will probably fail).

@Radim: Could you please fix the point 2?

Comment 1 Radim Hatlapatka 2014-07-30 08:27:20 UTC
PR: https://github.com/jbossas/jboss-eap/pull/1542

Comment 3 Radim Hatlapatka 2014-08-07 15:51:12 UTC
Proper pull request to 6.3.x branch: https://github.com/jbossas/jboss-eap/pull/1551

Comment 5 Petr Kremensky 2014-09-01 05:32:02 UTC
Verified on EAP 6.3.1.CP.CR1