Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wasm] Malformed testResults.xml causing CI test runs to fail #61749

Closed
radical opened this issue Nov 17, 2021 · 14 comments · Fixed by #61841
Closed

[wasm] Malformed testResults.xml causing CI test runs to fail #61749

radical opened this issue Nov 17, 2021 · 14 comments · Fixed by #61841
Assignees
Labels
arch-wasm WebAssembly architecture area-Infrastructure-mono blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms'
Milestone

Comments

@radical
Copy link
Member

radical commented Nov 17, 2021

Seen on #59479, build, log

Tests pass:

[18:29:38] info: Total: 1485, Errors: 0, Failed: 0, Skipped: 0, Time: 5.652435s
[18:29:38] info: 
[18:29:38] info: Flushed stdout!
[18:29:38] info: 1 Exit called with 0 when isXUnitDoneCheck=true  at set_exit_code (/main.js:240:24) at Object.init (/main.js:204:17).
[18:29:38] info: WASM EXIT 0

but then the log parsing fails:

Traceback (most recent call last):
  File "/datadisks/disk1/work/99FB08BE/p/reporter/run.py", line 68, in <module>
    main()
  File "/datadisks/disk1/work/99FB08BE/p/reporter/run.py", line 65, in main
    reporter.report_results(all_results)
  File "/etc/helix/scripts/helix/test_reporting/packing_test_reporter.py", line 27, in report_results
    results = [x for x in results if x]
  File "/etc/helix/scripts/helix/test_reporting/packing_test_reporter.py", line 27, in <listcomp>
    results = [x for x in results if x]
  File "/datadisks/disk1/work/99FB08BE/p/reporter/test_results_reader/__init__.py", line 99, in read_results
    for result in file_results:
  File "/datadisks/disk1/work/99FB08BE/p/reporter/test_results_reader/__init__.py", line 98, in <genexpr>
    file_results = (add_logs(tr, log_list) for tr in f.read_results(file_path))
  File "/datadisks/disk1/work/99FB08BE/p/reporter/formats/xunit.py", line 47, in read_results
    for (_, element) in xml.etree.ElementTree.iterparse(path, events=['end']):
  File "/usr/lib/python3.6/xml/etree/ElementTree.py", line 1221, in iterator
    yield from pullparser.read_events()
  File "/usr/lib/python3.6/xml/etree/ElementTree.py", line 1296, in read_events
    raise event
  File "/usr/lib/python3.6/xml/etree/ElementTree.py", line 1268, in feed
    self._parser.feed(data)
xml.etree.ElementTree.ParseError: not well-formed (invalid token): line 1101, column 6

Lines 1100,1101 from testResults.xml:

      <test name="XPathTests.FunctionalTests.Expressions.NodeSetsTests.NodeSetsTest181" type="XPathTests.FunctionalTests.Expressions.NodeSetsTests" method="NodeSetsTest181" time="0.000645" result="Pass" />  <test name="XPathTests.FunctionalTests.Expressions.NodeSetsTests.NodeSetsTest183" type="XPathTests.FunctionalTests.E
      <test name="XPathTests.FunctionalTests.Expressions.NodeSetsTests.NodeSetsTest185" type="XPathTests.FunctionalTests.Expressions.NodeSetsTests" method="NodeSetsTest185" time="0.00062" result="Pass" />

The top line there (1100) has an incomplete element:
<test name="XPathTests.FunctionalTests.Expressions.NodeSetsTests.NodeSetsTest183" type="XPathTests.FunctionalTests.E at the end.

cc @pavelsavara

@radical radical added the arch-wasm WebAssembly architecture label Nov 17, 2021
@ghost
Copy link

ghost commented Nov 17, 2021

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details

Seen on #59479, build, log

Tests pass:

[18:29:38] info: Total: 1485, Errors: 0, Failed: 0, Skipped: 0, Time: 5.652435s
[18:29:38] info: 
[18:29:38] info: Flushed stdout!
[18:29:38] info: 1 Exit called with 0 when isXUnitDoneCheck=true  at set_exit_code (/main.js:240:24) at Object.init (/main.js:204:17).
[18:29:38] info: WASM EXIT 0

but then the log parsing fails:

Traceback (most recent call last):
  File "/datadisks/disk1/work/99FB08BE/p/reporter/run.py", line 68, in <module>
    main()
  File "/datadisks/disk1/work/99FB08BE/p/reporter/run.py", line 65, in main
    reporter.report_results(all_results)
  File "/etc/helix/scripts/helix/test_reporting/packing_test_reporter.py", line 27, in report_results
    results = [x for x in results if x]
  File "/etc/helix/scripts/helix/test_reporting/packing_test_reporter.py", line 27, in <listcomp>
    results = [x for x in results if x]
  File "/datadisks/disk1/work/99FB08BE/p/reporter/test_results_reader/__init__.py", line 99, in read_results
    for result in file_results:
  File "/datadisks/disk1/work/99FB08BE/p/reporter/test_results_reader/__init__.py", line 98, in <genexpr>
    file_results = (add_logs(tr, log_list) for tr in f.read_results(file_path))
  File "/datadisks/disk1/work/99FB08BE/p/reporter/formats/xunit.py", line 47, in read_results
    for (_, element) in xml.etree.ElementTree.iterparse(path, events=['end']):
  File "/usr/lib/python3.6/xml/etree/ElementTree.py", line 1221, in iterator
    yield from pullparser.read_events()
  File "/usr/lib/python3.6/xml/etree/ElementTree.py", line 1296, in read_events
    raise event
  File "/usr/lib/python3.6/xml/etree/ElementTree.py", line 1268, in feed
    self._parser.feed(data)
xml.etree.ElementTree.ParseError: not well-formed (invalid token): line 1101, column 6

Lines 1100,1101 from testResults.xml:

      <test name="XPathTests.FunctionalTests.Expressions.NodeSetsTests.NodeSetsTest181" type="XPathTests.FunctionalTests.Expressions.NodeSetsTests" method="NodeSetsTest181" time="0.000645" result="Pass" />  <test name="XPathTests.FunctionalTests.Expressions.NodeSetsTests.NodeSetsTest183" type="XPathTests.FunctionalTests.E
      <test name="XPathTests.FunctionalTests.Expressions.NodeSetsTests.NodeSetsTest185" type="XPathTests.FunctionalTests.Expressions.NodeSetsTests" method="NodeSetsTest185" time="0.00062" result="Pass" />

The top line there (1100) has an incomplete element:
<test name="XPathTests.FunctionalTests.Expressions.NodeSetsTests.NodeSetsTest183" type="XPathTests.FunctionalTests.E at the end.

cc @pavelsavara

Author: radical
Assignees: -
Labels:

arch-wasm

Milestone: -

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged New issue has not been triaged by the area owner label Nov 17, 2021
@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@pavelsavara
Copy link
Member

@radical
Are you saying that the xml is damaged in the middle of line ? If so, that's very interesting.

@radical radical added the blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' label Nov 17, 2021
@pavelsavara
Copy link
Member

See how emscripten implaments putChar on stdout.
Could it be that something writes to it in between our resultsXml.Save ?

@pavelsavara
Copy link
Member

I mean into the tty.output char buffer there.

@pavelsavara
Copy link
Member

Or it could be buffering of WasmBrowserTestRunner
Or it could be browser console buffers or webSocket buffers on both sides.

@lewing lewing removed the untriaged New issue has not been triaged by the area owner label Nov 17, 2021
@lewing lewing added this to the 7.0.0 milestone Nov 17, 2021
@pavelsavara
Copy link
Member

Possibly related ? xunit/xunit#2090

@pavelsavara
Copy link
Member

We noticed that WasmConsoleStream.Flush is probably NOOP.

See base ConsoleStream

@pavelsavara
Copy link
Member

We noticed that WasmConsoleStream.Flush is probably NOOP.

That's the case for all platforms. So there is no point in calling it.

@ghost
Copy link

ghost commented Nov 18, 2021

Tagging subscribers to this area: @directhex
See info in area-owners.md if you want to be subscribed.

Issue Details

Seen on #59479, build, log

Tests pass:

[18:29:38] info: Total: 1485, Errors: 0, Failed: 0, Skipped: 0, Time: 5.652435s
[18:29:38] info: 
[18:29:38] info: Flushed stdout!
[18:29:38] info: 1 Exit called with 0 when isXUnitDoneCheck=true  at set_exit_code (/main.js:240:24) at Object.init (/main.js:204:17).
[18:29:38] info: WASM EXIT 0

but then the log parsing fails:

Traceback (most recent call last):
  File "/datadisks/disk1/work/99FB08BE/p/reporter/run.py", line 68, in <module>
    main()
  File "/datadisks/disk1/work/99FB08BE/p/reporter/run.py", line 65, in main
    reporter.report_results(all_results)
  File "/etc/helix/scripts/helix/test_reporting/packing_test_reporter.py", line 27, in report_results
    results = [x for x in results if x]
  File "/etc/helix/scripts/helix/test_reporting/packing_test_reporter.py", line 27, in <listcomp>
    results = [x for x in results if x]
  File "/datadisks/disk1/work/99FB08BE/p/reporter/test_results_reader/__init__.py", line 99, in read_results
    for result in file_results:
  File "/datadisks/disk1/work/99FB08BE/p/reporter/test_results_reader/__init__.py", line 98, in <genexpr>
    file_results = (add_logs(tr, log_list) for tr in f.read_results(file_path))
  File "/datadisks/disk1/work/99FB08BE/p/reporter/formats/xunit.py", line 47, in read_results
    for (_, element) in xml.etree.ElementTree.iterparse(path, events=['end']):
  File "/usr/lib/python3.6/xml/etree/ElementTree.py", line 1221, in iterator
    yield from pullparser.read_events()
  File "/usr/lib/python3.6/xml/etree/ElementTree.py", line 1296, in read_events
    raise event
  File "/usr/lib/python3.6/xml/etree/ElementTree.py", line 1268, in feed
    self._parser.feed(data)
xml.etree.ElementTree.ParseError: not well-formed (invalid token): line 1101, column 6

Lines 1100,1101 from testResults.xml:

      <test name="XPathTests.FunctionalTests.Expressions.NodeSetsTests.NodeSetsTest181" type="XPathTests.FunctionalTests.Expressions.NodeSetsTests" method="NodeSetsTest181" time="0.000645" result="Pass" />  <test name="XPathTests.FunctionalTests.Expressions.NodeSetsTests.NodeSetsTest183" type="XPathTests.FunctionalTests.E
      <test name="XPathTests.FunctionalTests.Expressions.NodeSetsTests.NodeSetsTest185" type="XPathTests.FunctionalTests.Expressions.NodeSetsTests" method="NodeSetsTest185" time="0.00062" result="Pass" />

The top line there (1100) has an incomplete element:
<test name="XPathTests.FunctionalTests.Expressions.NodeSetsTests.NodeSetsTest183" type="XPathTests.FunctionalTests.E at the end.

cc @pavelsavara

Author: radical
Assignees: -
Labels:

arch-wasm, blocking-clean-ci, area-Infrastructure-mono

Milestone: 7.0.0

@radical
Copy link
Member Author

radical commented Nov 19, 2021

Another one, but failing because:

2 Exit called with 0 when isXUnitDoneCheck=true  at set_exit_code (/main.js:240:24) at Object.init (/main.js:204:17).
<?xml version="1.0" encoding="utf-8"?>
<assemblies>

.. that debug message is showing up in the xml.

And another with:

<?xml version="1.0" encoding="utf-8"?>
2 Exit called with 0 when isXUnitDoneCheck=true  at set_exit_code (/main.js:240:24) at Object.init (/main.js:204:17).
<assemblies>

.. again with the debug message showing up in the second line.

Build

@pavelsavara
Copy link
Member

Both messages thru WS and thru chrome devtools protocol are written into same WasmTestMessagesProcessor.
Those sources are running in parallel.

@pavelsavara pavelsavara self-assigned this Nov 20, 2021
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Nov 23, 2021
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Nov 23, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Dec 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-Infrastructure-mono blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms'
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants