Open sergeyklay opened 3 years ago
Total time
240.175295
is 4 minutes, and it's the time required to run skeleton tests in Release Visual Studio build, right? It seems fast enough for CI. What is the total time for Visual Studio Debug build and for Mingw build?
I'm still working on this. Not all things are ready yet. But I'll provide results ASAP.
It might be worth reporting the Visual Studio problem with the infinite loop in Debug build.
Yeah. But TBH, I don't fully understand the nature of the issue and can't provide a minimal PoC
can't provide a minimal PoC
Minimal PoC will require effort, an I'm reluctant to spend the effort because I'm not sure the bug hasn't been fixed in newer or non-free versions. But I can provide exact instructions on reproducing this in Cygwin environment (starting with checking out re2c from git an on to running the hanging test). I'll have a look if there is an easy way to send such a bug report.
Please keep us informed on this issue.
@skvadrik I'm sorry for the silence and lack of any activity in this direction. Increased activity in my main job due to the end of the year. In any case I'm always here :)
@sergeyklay It's perfectly fine, I have the same problem with my day job. ;)
I haven't merged anything into master for weeks. In part this is because I have little time, and in part because I'm working on a local experiment. And I assume that you also have good reasons. Thanks for letting me know anyway, much appreciated!
@skvadrik The work has not been completed yet and some things have yet to be implemented, but general PoC looks like: https://github.com/sergeyklay/re2c/blob/feature/powershell-test-runner/run_tests.ps1
I'm not a Windows user, although I have a PC running this system. And looking back at the whole PowerShell-tests-runner-journey, I understand that I would not want to become the main maintainer of this solution. The issue from strategic point of view is, in the long run, I would not want to support this solution. Therefore, I would like to propose a universal solution that works equally well in all major systems - Python. What do you think about a test runner written in Python for Linux/UNIX as well as Windows systems? Would this be an acceptable for re2c project?
@sergeyklay That's a lot of work! Of course it's understandable if you wouldn't want to maintain it in the long run. I myself run Windows in a VM, and it is extremely slow and inconvenient. But the main disadvantage it the necessity to maintain different scripts on different platforms, they would diverge over time.
What do you think about a test runner written in Python for Linux/UNIX as well as Windows systems? Would this be an acceptable for re2c project?
Certainly, I think it is the best option. run_tests.sh is too complex for a bash script, and most of the time is spent on the test harness, not on running the tests themselves. And it's hard to maintain portability.
Fine! I'll start work on unified solution then!
Great! \o/
Skeleton tests are a little slow, but and they already pass too:
Run as time -v nice python run_tests.py --skeleton
Command being timed: "nice python run_tests.py --skeleton"
User time (seconds): 62.33
System time (seconds): 27.75
Percent of CPU this job got: 44%
Elapsed (wall clock) time (h:mm:ss or m:ss): 3:24.52
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 378976
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 1674
Minor (reclaiming a frame) page faults: 7844314
Voluntary context switches: 19387
Involuntary context switches: 97620
Swaps: 0
File system inputs: 0
File system outputs: 0
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 9
Page size (bytes): 16384
Exit status: 0
Awesome, thanks for all your work! \o/ (And I like this asciinema tool.)
A few notes from my latest unsuccessful attempt to enable skeleton tests on windows (and check if they are still too slow):
First, we need to change at least some of windows presets in CMakePresets.json to contain the word "skeleton" in the name (this triggers .github/workflows/ci-cmake.yml to enable the step that runs skeleton tests).
Then we need to change "Get build dir" step in .github/workflows/ci-cmake.yml to correctly set working directory (there is a problem with forward slashes) using definition like BUILD_DIR="${{ github.workspace }}\.build\${{ matrix.name }}-full"
.
Then we need to change run_tests.py.in to use windows-specific way to run the compiler. Currently the script fails as https://github.com/skvadrik/re2c/actions/runs/5451650795/jobs/9918139684:
Traceback (most recent call last):
File "C:\hostedtoolcache\windows\Python\3.11.4\x64\Lib\multiprocessing\pool.py", line 125, in worker
result = (True, func(*args, **kwds))
^^^^^^^^^^^^^^^^^^^
File "D:\a\re2c\re2c\.build\windows-msvc-debug-ootree-skeleton-full\run_tests.py", line 497, in run_test
process = subprocess.Popen(
^^^^^^^^^^^^^^^^^
File "C:\hostedtoolcache\windows\Python\3.11.4\x64\Lib\subprocess.py", line 1026, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\hostedtoolcache\windows\Python\3.11.4\x64\Lib\subprocess.py", line 1538, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [WinError 2] The system cannot find the file specified
Perhaps some file paths are wrong (a problem forward slashes?). The compiler invocation also needs to be adjusted for windows, as well as output file extension, etc.
Hello,
I'm currently developing a native PowerShell wrapper for running re2c tests on Windows without resorting to Mingw, Cygwin and so on. I managed to write multi-threaded tests runner using PowerShell only (right now for skeleton tests only).
I run tests on my 20 cores Xeon in parallel and everything is going well except for some tests. They are super slow. After a dig into, I realized that these tests are extremely slow due to the generation process. Below I provide measurements of some generations:
6.8190486 seconds
9.3340122 seconds
7.642483 seconds
13.0525341 seconds:
265.9861263 seconds: 🎉
Actually this is not a complete list. Some tests never finished. According to my quick look, slow tests are about 9%. The rest of the tests are as fast as, for example, in macOs or Linux. re2c using built with the following configuration
Manual run shows the same degradation:
I will publish additional comments during my research.