enhancement
major
major
major
#29837
TestCompileJSPs modifies the module's source webapp and breaks concurrently running scripted tests of the same module
Problem
TestCompileJSPs (run by the TestAll of every module) prepares the JSP compilation in the module's own source webapp src/main/webapp:
- it renames WEB-INF/web.xml to WEB-INF/web.xml.bak and writes a generated web.xml in its place,
- it copies the .tld, .inc and .jspf files of all dependency modules into the source webapp (e.g. WEB-INF/tlds/ajax-form.tld from com.top_logic),
- after the compilation it deletes the copies and restores the original web.xml.
Any other process using the same webapp directory at that time sees the temporary state. In the PR build tl-ci-pr #37, the scripted tests of tl-demo (a TestedApplication with the webapp root com.top_logic.demo/src/main/webapp) ran in a separate Maven run in parallel with the module tests of tl-demo. While TestCompileJSPs of tl-demo was running, the Jasper of the scripted application picked up the temporary TLD copies; after they were deleted, rendering JSPs failed:
JasperException: java.io.FileNotFoundException: .../com.top_logic.demo/src/main/webapp/WEB-INF/tlds/ajax-form.tld (No such file or directory)
followed by ClassNotFoundException: org.apache.jsp.jsp.element.create.GenericCreate_jsp etc. for every later rendering of the affected JSPs.
Whether this happens depends on timing: in a partial PR build with few test modules, the module test run reaches tl-demo just when the scripted tests start rendering JSPs.
A test killed during the compilation additionally leaves the source tree modified (web.xml renamed, copied TLDs).
Solution
TestCompileJSPs assembles a separate web application in its scratch directory from the application's resource path (the module's own webapp and the webapps / web fragments of its dependencies, in overlay order): the JSPs, the statically included files, the TLDs and a generated web.xml. The JSP compiler runs on this copy. The source webapp of the module is only read.
Test
TestCompileJSPs in com.top_logic, com.top_logic.element and com.top_logic.demo passes and leaves src/main/webapp unchanged.