Closed kateinoigakukun closed 8 months ago
@swift-ci test
@swift-ci test macos
@MaxDesiatov macOS build for corelibs-xctest has been broken for a while unfortunately...
@stmontgomery If we can get this merged before the next branch cut, it would be appreciated because this patch is the last difference from the fork. Most of the changes are guarded by a macro and should not affect other platforms. :bow:
I wish there were a way to achieve this with less branching, but without reasync support in the compiler, I doubt we can do much better.
Yeah, that's a very unfortunate situation to have many branching here due to function-colors. I agree that we can improve it with reasync
support in the future.
Besides the details of the code changes in the PR, I'm interested in learning more about the plans for ongoing support and maintenance of this compilation mode and platform. In particular, what kind of CI and testing is in place, or expected to come in the near future?
Yes, at least I'm going to include XCTest and Foundation build in the WebAssembly build CI after this will get merged: https://ci.swift.org/job/oss-swift-pr-test-crosscompile-wasm-ubuntu-20_04/
Also, as you mentioned, we can build and run tests with this mode on other platforms.
@swift-ci test
@swift-ci test
Let’s take a good look at CI results, but the diff looks ok to me now! Thanks for discussing and the quick turnaround on the revisions.
@swift-ci test windows
Thanks a lot for your review @briancroom! I assume we need @shahmishal's help to get this merged by temporarily bypassing PR status check, right?
This change might have broken some tests especially if there are many test cases. (I'm sorry if I was wrong.)
@kkk669 Yes, the implementation is changed from the version used in the downstream, so some of large async test cases might not work. It will be mitigated after tail-call support.
WASI does not have thread spawning method yet, but the existing implementation blocks threads to wait async test cases synchronously. This commit introduced a new waiter method for running async test cases in single-threaded WASI environments, enabled by USE_SWIFT_CONCURRENCY_WAITER flag.
With the new waiter,
XCTMain
is async runs the given test suites without blocking the thread by bypassing some synchronous public APIs likeXCTest.perform
andXCTest.run
. This ignores those APIs even if they are overridden by user-defined subclasses, so it's not 100% compatible with the existing XCTest APIs. This is a trade-off to support async test execution in single-threaded environments, but it should be fine because the APIs are seldom overridden by user code.