Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tools for testing Swift concurrency #157

Open
stephencelis opened this issue May 25, 2022 · 3 comments
Open

Tools for testing Swift concurrency #157

stephencelis opened this issue May 25, 2022 · 3 comments

Comments

@stephencelis
Copy link

stephencelis commented May 25, 2022

A couple of weeks ago I brought up on the forums that it's basically impossible to write reliable tests for concurrent code: https://forums.swift.org/t/reliably-testing-code-that-adopts-swift-concurrency/57304

This repo has a bunch of internal code that aids in testing isolated async code, e.g. its sequences, in predictable, reproducible, and fast ways. This includes custom clocks, executors, and more.

Tools like these would ideally be more widely available to users that want to test async code, and should be extracted from this repo. They still won't make it possible to test async code that is threaded between actors, but hopefully this issue is also on Apple's radar, and a solution is in the works.

@phausler
Copy link
Member

The first step of this is done; extracting the support into it's own package. I think the next step is to isolate more general purpose items and codify those into a maintainable general purpose testing infrastructure.

@adhityasp
Copy link

adhityasp commented Jul 24, 2024

Any updates for more stable unit test?

@Esquilli
Copy link

Bumping this

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

No branches or pull requests

4 participants