Posting UIApplicationDidFinishLaunchingNotification Causes XCTest to Begin New Test Suite
| Originator: | |||
| Number: | rdar://17400456 | Date Originated: | 20-Jun-2014 04:59 PM |
| Status: | Open | Resolved: | No |
| Product: | Developer Tools | Product Version: | Current |
| Classification: | Serious Bug | Reproducible: | Always |
Summary: There are two requirements to reproducing this bug: an asynchronous test that is tested by spinning the run loop, and having posted the aforementioned notification before the run loop is spun. Steps to Reproduce: 1. Download attached sample project and decompress. 2. Run the tests with breakpoints enabled Expected Results: `invokeTest` in MySuite should only be called for the third time after the second call has returned. Actual Results: `invokeTest` in MySuite is called for the third time during spinning of the run loop in the second invocation. Version: Xcode 5.1.1, OS X Mavericks (latest) Notes: This is contrived since I originally encountered the issue using the Kiwi framework, which builds its examples and invokes them as it sees fit. Posting the application did finish launching notification is often necessary in testing, so I don't think this should be considered expected behavior. A workaround can be achieved by applying a lock to the user implementation of invokeTests, though an empty test suite will still be reported. Configuration: Attachments: 'xctest-run-bug.zip' was successfully uploaded.
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!