Isolate global state between tests by isolating tests
Originator: | ash | ||
Number: | rdar://34876469 | Date Originated: | 8/10/2017 |
Status: | Open | Resolved: | |
Product: | Developer Tools | Product Version: | |
Classification: | Reproducible: |
Often, when writing unit tests, developers will introduce bugs into their tests by running code that modifies global mutable state, such as UserDefaults. It would be nice if test files or even individual tests were run in separate processes to make sure a failure to tear down one test doesn't lead to a false positive or false negative in a subsequent test. Randomizing the order of tests runs helps with this, too. See rdar://34873492
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!