Isolate global state between tests by isolating tests

Originator:steipete
Number:rdar://34876682 Date Originated:08-Oct-2017 10:42 PM
Status:Open Resolved:
Product:Developer Tools Product Version:
Classification:Enhancement Reproducible:Always
 
Summary:
This is a duplicate of radar #34876469

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


Steps to Reproduce:
 

Expected Results:
 

Actual Results:
 

Version:
 

Notes:

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!