Page MenuHomePhabricator

selenium-daily Jenkins jobs fail sometimes with: "Failed to read test report file"
Closed, DuplicatePublic

Description

Example:

1Failed to read test report file /srv/jenkins/workspace/selenium-daily-betacommons-MediaWiki/log/WDIO.xunit-2022-09-06T01-22-39-639Z.xml
2org.dom4j.DocumentException: Error on line 24 of document : Content is not allowed in trailing section.
3 at org.dom4j.io.SAXReader.read(SAXReader.java:511)
4 at org.dom4j.io.SAXReader.read(SAXReader.java:392)
5 at hudson.tasks.junit.SuiteResult.parse(SuiteResult.java:177)
6 at hudson.tasks.junit.TestResult.parse(TestResult.java:384)
7 at hudson.tasks.junit.TestResult.parsePossiblyEmpty(TestResult.java:314)
8 at hudson.tasks.junit.TestResult.parse(TestResult.java:256)
9 at hudson.tasks.junit.TestResult.parse(TestResult.java:242)
10 at hudson.tasks.junit.TestResult.parse(TestResult.java:220)
11 at hudson.tasks.junit.TestResult.<init>(TestResult.java:174)
12 at hudson.tasks.junit.JUnitParser$ParseResultCallable.invoke(JUnitParser.java:176)
13 at hudson.FilePath$FileCallableWrapper.call(FilePath.java:3502)
14 at hudson.remoting.UserRequest.perform(UserRequest.java:211)
15 at hudson.remoting.UserRequest.perform(UserRequest.java:54)
16 at hudson.remoting.Request$2.run(Request.java:376)
17 at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78)
18 at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
19 at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
20 at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
21 at java.base/java.lang.Thread.run(Thread.java:829)
22Caused by: org.xml.sax.SAXParseException; lineNumber: 24; columnNumber: 14; Content is not allowed in trailing section.
23 at java.xml/com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:204)
24 at java.xml/com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:178)
25 at java.xml/com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:400)
26 at java.xml/com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327)
27 at java.xml/com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1465)
28 at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$TrailingMiscDriver.next(XMLDocumentScannerImpl.java:1433)
29 at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:605)
30 at java.xml/com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112)
31 at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:534)
32 at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:888)
33 at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:824)
34 at java.xml/com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
35 at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1216)
36 at java.xml/com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:635)
37 at org.dom4j.io.SAXReader.read(SAXReader.java:494)
38 ... 18 more

testReport/WDIO.xunit-2022-09-06T01-22-39-639Z.xml
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
  <testsuite name="BlankPage" timestamp="2022-09-06T01:22:43" time="1.936" tests="1" failures="0" errors="0" skipped="0">
    <properties>
      <property name="specId" value="0"/>
      <property name="suiteName" value="BlankPage"/>
      <property name="capabilities" value="chrome.97_0_4692_99.linux"/>
      <property name="file" value="./tests/selenium/wdio-mediawiki/specs/BlankPage.js"/>
    </properties>
    <testcase classname="chrome.97_0_4692_99.linux.BlankPage" name="should have its title @daily" time="1.932">
      <system-out><![CDATA[
COMMAND: navigateTo - {"url":"https://commons.wikimedia.beta.wmflabs.org/w/index.php?uselang=en&title=Special%3ABlankPage"}
RESULT: undefined
COMMAND: findElement - {"using":"css selector","value":"#firstHeading"}
RESULT: undefined
COMMAND: getElementText - {"elementId":"ELEMENT-1"}
RESULT: undefined
COMMAND: takeScreenshot - {}
COMMAND: deleteSession - {}
RESULT: undefined
]]></system-out>
    </testcase>
  </testsuite>
</testsuites>\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tconst api = new mw.Api();\n\n\t\t\tapi.get( query ).then(\n\t\t\t\tfunction ( response ) {\n\t\t\t\t\treturn response;\n\t\t\t\t},\n\t\t\t\tfunction () {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t);\n\t\t}).apply(null, arguments)","args":[{"action":"query","format":"json","prop":"info","titles":"BeforeEach-name-0.40889744268558514-Iñtërnâtiônà lizætiøn"}]}
COMMAND: deleteAllCookies - {}
RESULT: undefined
]]></system-out>
    </testcase>
    <testcase classname="chrome.97_0_4692_99.linux.Page" name="should have history @daily" time="0">
      <skipped/>
      <system-out><![CDATA[
COMMAND: executeScript - {"script":"return (( query ) => {\n\t\t\tif ( typeof mw !== 'undefined' ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tconst api = new mw.Api();\n\n\t\t\tapi.get( query ).then(\n\t\t\t\tfunction ( response ) {\n\t\t\t\t\treturn response;\n\t\t\t\t},\n\t\t\t\tfunction () {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t);\n\t\t}).apply(null, arguments)","args":[{"action":"query","format":"json","prop":"info","titles":"BeforeEach-name-0.393895921322571-Iñtërnâtiônà lizætiøn"}]}
COMMAND: deleteSession - {}
RESULT: undefined
]]></system-out>
    </testcase>
  </testsuite>
</testsuites>

Event Timeline

hashar subscribed.

The XML has:

</testsuites>\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tconst api = new mw.Api();\n\n\t\t\tapi.get( query ).then(\n\t\t\t\tfunction ( response ) {\n\t\t\t\t\treturn response;\n\t\t\t\t},\n\t\t\t\tfunction () {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t);\n\t\t}).apply(null, arguments)","args":[{"action":"query","format":"json","prop":"info","titles":"BeforeEach-name-0.40889744268558514-Iñtërnâtiônà lizætiøn"}]}
COMMAND: deleteAllCookies - {}
RESULT: undefined

That is 99.99% T307914