Skip to content

Simplify and improve runSuspendTest#864

Open
pm47 wants to merge 3 commits into
masterfrom
improve-runtest
Open

Simplify and improve runSuspendTest#864
pm47 wants to merge 3 commits into
masterfrom
improve-runtest

Conversation

@pm47

@pm47 pm47 commented Jul 2, 2026

Copy link
Copy Markdown
Member

Follow-up to #861.

@pm47 pm47 requested a review from sstone July 2, 2026 16:29
pm47 added 2 commits July 2, 2026 19:50
The custom iOS test runner existed only to work around NativeSocket
delivering its callbacks on the main GCD queue: it ran the test body
on the main dispatcher and pumped the main run loop, which a plain
runBlocking would have starved. Since the previous commit, callbacks
are delivered on a dedicated queue, so the workaround is obsolete.

The runBlocking actuals are now identical on all platforms and can be
removed.
Report a test timeout as an assertion failure with an explicit message
instead of a bare TimeoutCancellationException, whose Kotlin/Native
stack trace points into the coroutines runtime and says nothing.

On timeout, also cancel the test job and wait for its coroutines to
complete their cleanup before failing: output printed after a test is
reported finished is attributed to no running test, which can crash
gradle's test listener (NullPointerException: "runningOp" is null).
@pm47 pm47 force-pushed the improve-runtest branch from 3edee10 to 0a218c5 Compare July 2, 2026 18:04
@pm47 pm47 marked this pull request as ready for review July 2, 2026 18:36
Comment thread modules/core/src/commonTest/kotlin/fr/acinq/lightning/tests/utils/runTest.kt Outdated
@pm47 pm47 force-pushed the improve-runtest branch from 0fec47b to 0da7f88 Compare July 7, 2026 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants