Skip to content

Allow VirtualTimeScheduler to run on any thread #2610

Merged
freak4pc merged 2 commits intoReactiveX:mainfrom
danielt1263:Update-to-VirtualTimeScheduler
Nov 14, 2024
Merged

Allow VirtualTimeScheduler to run on any thread #2610
freak4pc merged 2 commits intoReactiveX:mainfrom
danielt1263:Update-to-VirtualTimeScheduler

Conversation

@danielt1263
Copy link
Copy Markdown
Collaborator

…as long as critical methods are all called on the same thread.

This is designed to fix issue #2609

@danielt1263 danielt1263 self-assigned this Jul 10, 2024
@danielt1263 danielt1263 linked an issue Jul 10, 2024 that may be closed by this pull request
17 tasks
@danielt1263
Copy link
Copy Markdown
Collaborator Author

As far as I can tell, this is 100% backwards compatible and doesn't require any API change from users of the library. It may not solve every future use-case that Swift Testing might throw at it, but it solves the single most obvious one.

I see no reason that this can't be accepted into the next minor release/update.

@bennnjamin
Copy link
Copy Markdown

bennnjamin commented Aug 23, 2024

What's the hold up in getting this merged? Would love to start being able to migrate our RxSwift tests to Swift Testing @nikolaykasyanov @danielt1263

@freak4pc
Copy link
Copy Markdown
Member

freak4pc commented Oct 3, 2024

We'll need someone with a meaningful RxSwift-based test suite to test this to make sure it doesn't break existing tests.

@nikolaykasyanov
Copy link
Copy Markdown
Contributor

@freak4pc I'll try it out and report back.

@nikolaykasyanov
Copy link
Copy Markdown
Contributor

@freak4pc I tried this PR on our relatively big test suite (around 1800 tests, most of which use TestScheduler) and didn't find any issues ✅ . To be sure, I also ran the suite repeatedly 10 times ✅ and with thread sanitizer ✅ .

@freak4pc
Copy link
Copy Markdown
Member

@freak4pc I tried this PR on our relatively big test suite (around 1800 tests, most of which use TestScheduler) and didn't find any issues ✅ . To be sure, I also ran the suite repeatedly 10 times ✅ and with thread sanitizer ✅ .

That's awesome, thanks Nikolay!

@freak4pc freak4pc merged commit 8932598 into ReactiveX:main Nov 14, 2024
@danielt1263 danielt1263 deleted the Update-to-VirtualTimeScheduler branch November 14, 2024 10:17
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.

Why is VirtualTimeScheduler checking to ensure it's on the main thread?

4 participants