Repository navigation
Generate junit report when pytest-timeout kills pytest - #5832
Conversation
Unit Test Results 12 files ± 0 12 suites ±0 7h 13m 24s ⏱️ + 14m 11s For more details on these failures, see this check. Results for commit 5c694f3. ± Comparison against base commit d2d76c0. ♻️ This comment has been updated with latest results. |
47cc67d to
377ffcd
Compare
fjetter
left a comment
There was a problem hiding this comment.
I would prefer not to use print but this is not a strong opinion since this is only a small script.
I am wondering how stable the xml output and stdout of pytest is but I assume it is sufficient for our purposes?
| timestamp = datetime.now().strftime("%Y-%m-%dT%H:%M:%S.%f") | ||
|
|
||
| # We could have used ElementTree but it feels like overkill here | ||
| print('<?xml version="1.0" encoding="utf-8"?>') |
There was a problem hiding this comment.
printing is an interesting choice.
I assume this was done for debugging? Why not write to a file or file-like object? This way we could write the proper file out directly and/or put sys.stdout in for debugging
There was a problem hiding this comment.
No particular reason for the choice; the support in pytest for capturing stdout is good and clean so it doesn't really make a difference.
I am wondering how stable the xml output and stdout of pytest is but I assume it is sufficient for our purposes?
Perfectly stable.
Closes #5798
Enabled and tested 'signal' method of pytest-timeout on MacOSX in addition to Linux. This means that when pytest-timeout kicks in it selectively kills the stuck test.
On Windows, the 'signal' method is not available and pytest-timeout kills the whole process. When it does, pytest won't generate a junit report. When this happens, parse the pytest stdout and generate one. Obviously, any tests that were supposed to run after the hung test will be missing.
Demo: https://github.com/dask/distributed/runs/5264200578