Isolate global state between tests by isolating tests

Originator:weyert
Number:rdar://34882063 Date Originated:09-Oct-2017 11:32 am
Status:Open Resolved:
Product:Developer Tools Product Version:
Classification:Security 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!