apple / apple/swift-async-algorithms
Tools for testing Swift concurrency
- Dominant language
- Swift
- Stars
- 3.7k
- Forks
- 226
- Avg merge
- 10d 3h
- Merged PRs (30d)
- 1
Description
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.
Contributor guide
Research direction
Start with the linked Swift forums discussion, then inspect this repository's internal testing code for custom clocks, executors, and related tools. Determine which isolated async-code utilities can be extracted for wider use and define the supported testing scope, excluding code threaded between actors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- testing
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100