-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Run test262 tests in parallel #564
Conversation
This commit introduces a couple of changes in order to make run-test262 go brr and execute tests in parallel: - Remove CONFIG_AGENT build option. The disabled version of the build was already broken and no one noticed, Remove the define altogether. - Remove the -C switch. Hard to support in multi-threaded mode. I may bring it back some day because it _is_ useful. - Remove the -r switch. Also hard to support and I never look at test262_report.txt anyway so on the chopping block it goes. - Judicious use of thread-local storage so I don't have to thread through state everywhere and embiggen the diff even more. This is what Real Programmers(TM) do: stay up coding way past midnight just so the test suite finishes in one minute instead of four. Fixes: quickjs-ng#547
Right, tcc and gcc48 of course don't understand |
Good news: TSan seems pleased with this version of run-test262 Bad news: TSan is waaaay too slow for CI, it takes literal CPU hours to churn through test262... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool! Left some quick notes, will do a more thorough review tonight!
.github/workflows/ci.yml
Outdated
@@ -84,20 +83,6 @@ jobs: | |||
run: | | |||
sudo sysctl -w kernel.randomize_va_space=0 | |||
|
|||
- name: install TCC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any chance we can keep the removed CI by not compiling test262? The interpreter should work just fine...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, good idea, done. Should've thought of that myself (but hey, way past midnight.)
@@ -1268,13 +1296,7 @@ static int eval_buf(JSContext *ctx, const char *buf, size_t buf_len, | |||
if (JS_IsException(res_val)) { | |||
exception_val = JS_GetException(ctx); | |||
is_error = JS_IsError(ctx, exception_val); | |||
/* XXX: should get the filename and line number */ | |||
if (outfile) { | |||
if (!is_error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not keep this part?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's part of the -r switch (reportfile
config option) that I removed.
BOOL is_dir_list; | ||
BOOL only_check_errors = FALSE; | ||
const char *filename; | ||
const char *ignore = ""; | ||
BOOL is_test262_harness = FALSE; | ||
BOOL is_module = FALSE; | ||
|
||
#if !defined(_WIN32) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess you removed this because we are not building the binary on windows yet, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's right. run-test262 didn't (and doesn't) build on win32 anyway so no point in the ifdef guard.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Turns out it did build with mingw because mingw apparently includes pthreads?
I changed it to #if !defined(__MINGW32__)
, I think that also covers mingw-w64.
.github/workflows/ci.yml
Outdated
@@ -160,38 +160,6 @@ jobs: | |||
run: | | |||
time make test262 | |||
|
|||
linux-gcc48: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we not save this one? If you are worried about the CMake checks, we could remove 262 from all and have it compiled when we run the test262* targets, WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a version check to CMakeLists.txt, hope that's good enough.
No pb with this.
The report file is useful for 2 purposes:
I understand the output to the report file is non deterministic, which might have prompted your decision to remove the option, but it could have deserved a separate PR.
I am not sure passing
Kudos to you for this. |
No disagreement. The reason for removal is that the output becomes inaccurate with multiple threads: the progress thread no longer knows when exactly a test failed or succeeded, only that it did.
It's not that but that it's sprinkled piecemeal across run-test262.c in an undisciplined fashion. I kind of had it working by wrapping every fprintf in a critical section but I hated the looks of it and opted to remove it altogether. If you feel really strongly, I could bring it back, but I never use it myself and I won't miss it; |
Oh, one more:
It's inconvenient for the agent-related code. I'd have turned it into runtime or context opaque data but it already uses that for something else (and also whether it's set or not.) Maybe not insurmountable but this felt easier / less prone to subtle bugs. |
This commit introduces a couple of changes in order to make run-test262 go brr and execute tests in parallel:
Remove CONFIG_AGENT build option. The disabled version of the build was already broken and no one noticed, Remove the define altogether.
Remove the -C switch. Hard to support in multi-threaded mode. I may bring it back some day because it is useful.
Remove the -r switch. Also hard to support and I never look at test262_report.txt anyway so on the chopping block it goes.
Judicious use of thread-local storage so I don't have to thread through state everywhere and embiggen the diff even more.
This is what Real Programmers(TM) do: stay up coding way past midnight just so the test suite finishes in one minute instead of four.
Fixes: #547