When using my application, I came across a race condition in some code that uses NSOperationQueue
to run tasks asynchronously after events triggered by the user. I know how to fix the race condition, since this is a stupid design error that I will not delve into, but I would like to prove a mistake with a test case (so that it does not return during line optimization / refactoring). It guarded me. How can you test something multithreaded, especially if the goal of the test is to generate a race condition?
Does anyone have any links to reference material that I can reference when it comes to working with threads and unit testing? I am particularly interested in the generation of the race.
multithreading objective-c unit-testing cocoa
d11wtq
source share