Bug 1111137

Summary: (6.4.0) WebsocketTestCase doesn't do correct cleanup
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Ondrej Lukas <olukas>
Component: TestsuiteAssignee: jboss-set
Status: CLOSED CURRENTRELEASE QA Contact: Petr Kremensky <pkremens>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.3.0CC: bbaranow, cdewolf, pkremens, pslavice
Target Milestone: DR1   
Target Release: EAP 6.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1123901 (view as bug list) Environment:
Last Closed: 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: 1119147    
Bug Blocks: 1123901    

Description Ondrej Lukas 2014-06-19 10:37:26 UTC
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]

Comment 1 Josef Cacek 2014-07-23 14:42:31 UTC
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 2 Radim Hatlapatka 2014-07-30 08:27:33 UTC
PR: https://github.com/jbossas/jboss-eap/pull/1542

Comment 3 Petr Kremensky 2014-09-19 07:55:36 UTC
Verified on EAP 6.4.0.DR1.1