Now that cancellation is mostly handled, there's one last concurrency issue remaining for Alamofire: testing with the thread sanitizer enabled. On our
feature/async-handlers branch, running a single test in
ConcurrencyTests works just fine with the sanitizer enabled. Trying to run multiple tests with the sanitizer enabled leads to many sanitizer issues for each test. For a run of the 10 test methods in
DataConcurrencyTests I get 46 sanitizer warnings. The entire rest of Alamofire's test suite produces zero. (We did recently fix some safety issues with our
dynamicMemeberLookup use, but those didn't appear in the sanitizer.)
There are so many I had to turn it into a gist: Alamofire Test Thread Sanitizer Issues · GitHub
Some seem to be issues in the concurrency runtime, some are in Alamofire itself, especially between property getters and initializers, which doesn't make much sense. Even running just two tests results in three warnings.
So, do I have an actual safety issue, or are there issues with the thread sanitizer and async tests (or concurrency APIs in general)? Anyone else seeing this? Should this be a Swift or Apple bug report?