Skip to content

Refactor eventually to ensure wall-clock time usage#5705

Merged
sksamuel merged 28 commits intomasterfrom
sks/fix-5147
Feb 22, 2026
Merged

Refactor eventually to ensure wall-clock time usage#5705
sksamuel merged 28 commits intomasterfrom
sks/fix-5147

Conversation

@sksamuel
Copy link
Copy Markdown
Member

@sksamuel sksamuel commented Feb 19, 2026

Now eventually will detect virtual time and flip onto a wall-clock time instead.

Fixes #5147

@sksamuel sksamuel requested a review from a team as a code owner February 19, 2026 22:54
@sksamuel sksamuel enabled auto-merge February 19, 2026 22:56
Comment thread kotest-common/src/commonMain/kotlin/io/kotest/common/withNonVirtualTimeout.kt Outdated
@sksamuel
Copy link
Copy Markdown
Member Author

@OliverO2 I want to be conscious of your users who might be using Kotest's assertions library. Is there anything in this that would give you concern? Essentially, updating eventually to check for TestDispatcher and if virtual time is present, then using a wall clock implementation (that I think you derived actually), since eventually using virtual time makes no sense.

sksamuel and others added 6 commits February 19, 2026 22:17
…n CI

The default PRODUCT_NAME was set to IC-261 which caused gradle-check CI
jobs (which don't set PRODUCT_NAME) to compile the IntelliJ plugin against
the IC-261 EAP snapshot. That EAP bundles Kotlin with metadata version 2.4.0,
which is incompatible with the project's Kotlin 2.2.x compiler.

Revert the default to IC-253 so that CI gradle-check jobs build against the
stable 2025.3 platform. The dedicated IC-261 workflow jobs set PRODUCT_NAME
explicitly and override the Kotlin version to 2.3.10.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@OliverO2
Copy link
Copy Markdown
Contributor

Thanks for pinging! Ensuring real time for eventually, even when on the TestDispatcher, makes sense. I did that a while ago in a simpler implementation, which did not care to interrupt a single block invocation. Your implementation offers more interruption points.

So all is good! Another question is whether it would make sense at all to use real-time eventually and a virtual time test dispatcher at the same time. But at least this PR makes it safer if you do.

Copy link
Copy Markdown
Member

@AlexCue987 AlexCue987 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sksamuel sksamuel added this pull request to the merge queue Feb 22, 2026
Merged via the queue into master with commit 335df15 Feb 22, 2026
13 checks passed
@sksamuel sksamuel deleted the sks/fix-5147 branch February 22, 2026 06:05
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.

Ugrading Kotest Assertsions from 6.0.3 to 6.0.4 Failed My Tests

3 participants