Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 11 crashes when running Unit Tests in parallel for framework project

The first test will start up and about half a second later Xcode will lock up instead of starting another test. About 30 seconds after that, Xcode crashes and I get the following crash log (see below).

  • This started happening after I upgraded to Xcode 11.
  • If I run unit tests in serial it works just fine.
  • Strangely it seems to only happen on my 2018 Macbook Pro. On other Macbooks and Mac Minis the unit tests are able to run tests in parallel without the crash.
  • It only happens with the unit tests. I can run the UI tests for my project in parallel.
  • I have another framework-based project on the same machine that is experiencing the same issue.
  • I've tried deleting and re-installing Xcode several times.
  • Edit: I just now tried wiping the hard drive of the Macbook and reinstalling Mac OS. The issue persists.
Process:               Xcode [823]
Path:                  /Applications/Xcode.app/Contents/MacOS/Xcode
Identifier:            com.apple.dt.Xcode
Version:               11.0 (14936)
Build Info:            IDEFrameworks-14936000000000000~3
App Item ID:           497799835
App External ID:       832762837
Code Type:             X86-64 (Native)
Parent Process:        ??? [1]
Responsible:           Xcode [823]
User ID:               501

Date/Time:             2019-09-23 16:39:38.684 -0700
OS Version:            Mac OS X 10.14.6 (18G95)
Report Version:        12
Bridge OS Version:     3.6 (16P6571)
Anonymous UUID:        BC74C3A5-0B03-9716-16C5-8C448AD75627


Time Awake Since Boot: 1600 seconds

System Integrity Protection: enabled

Crashed Thread:        27

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Application Specific Information:
ProductBuildVersion: 11A420a
ASSERTION FAILURE in /Library/Caches/com.apple.xbs/Sources/DVTFrameworks/DVTFrameworks-14899/DVTFoundation/Multicore/DVTFuture.mm:376
Details:  Attempted to transition to the failed state, but did not provide an error.
<DVTFuture 0x7fc173624f60 Running>
    Progress:    Initial
    Result:      (null)
    Error:       (null)
    Started at:    0   -[DVTFuture init] (in DVTFoundation)
  1   -[DVTFuture initWithBlock:] (in DVTFoundation)
  2   +[DVTFuture futureWithBlock:] (in DVTFoundation)
  3   -[DVTiPhoneSimulator launchSimulatedExecutable:launchService:error:] (in IDEiOSSupportCore)
  4   __55-[IDELaunchiPhoneSimulatorLauncher performWorkerAction]_block_invoke (in IDEiOSSupportCore)
  5   __43-[DVTDispatchLock asyncPerformLockedBlock:]_block_invoke (in DVTFoundation)
  6   __DVT_CALLING_CLIENT_BLOCK__ (in DVTFoundation)
  7   __DVTDispatchBarrierAsync_block_invoke (in DVTFoundation)
  8   _dispatch_call_block_and_release (in libdispatch.dylib)
  9   _dispatch_client_callout (in libdispatch.dylib)
 10   _dispatch_lane_serial_drain (in libdispatch.dylib)
 11   _dispatch_lane_invoke (in libdispatch.dylib)
 12   _dispatch_workloop_worker_thread (in libdispatch.dylib)
 13   _pthread_wqthread (in libsystem_pthread.dylib)
 14   start_wqthread (in libsystem_pthread.dylib)

    Finished at: (null)
Object:   <DVTFuture: 0x7fc173624f60>
Method:   -_internalSetState:result:error:
Thread:   <NSThread: 0x7fc17336ae40>{number = 81, name = (null)}
Hints:   

Backtrace:
  0   -[IDEAssertionHandler handleFailureInMethod:object:fileName:lineNumber:assertionSignature:messageFormat:arguments:] (in IDEKit)
  1   _DVTAssertionHandler (in DVTFoundation)
  2   _DVTAssertionFailureHandler (in DVTFoundation)
  3   -[DVTFuture _internalSetState:result:error:] (in DVTFoundation)
  4   __35-[DVTFuture setState:result:error:]_block_invoke (in DVTFoundation)
  5   invocation function for block in decltype(fp0()) DVTDispatchLockPerformLockedWriterBlock<void () block_pointer () block_pointer __strong>(DVTDispatchLock*, void () block_pointer () block_pointer __strong) (in DVTFoundation)
  6   _dispatch_client_callout (in libdispatch.dylib)
  7   _dispatch_lane_barrier_sync_invoke_and_complete (in libdispatch.dylib)
  8   DVTDispatchBarrierSync (in DVTFoundation)
  9   -[DVTDispatchLock performLockedBlock:] (in DVTFoundation)
 10   decltype(fp0()) DVTDispatchLockPerformLockedWriterBlock<void () block_pointer () block_pointer __strong>(DVTDispatchLock*, void () block_pointer () block_pointer __strong) (in DVTFoundation)
 11   -[DVTFuture setState:result:error:] (in DVTFoundation)
 12   -[DVTFuture failWithError:] (in DVTFoundation)
 13   __68-[DVTiPhoneSimulator launchSimulatedExecutable:launchService:error:]_block_invoke (in IDEiOSSupportCore)
 14   -[DVTFuture initWithBlock:] (in DVTFoundation)
 15   +[DVTFuture futureWithBlock:] (in DVTFoundation)
 16   -[DVTiPhoneSimulator launchSimulatedExecutable:launchService:error:] (in IDEiOSSupportCore)
 17   __55-[IDELaunchiPhoneSimulatorLauncher performWorkerAction]_block_invoke (in IDEiOSSupportCore)
 18   __43-[DVTDispatchLock asyncPerformLockedBlock:]_block_invoke (in DVTFoundation)
 19   __DVT_CALLING_CLIENT_BLOCK__ (in DVTFoundation)
 20   __DVTDispatchBarrierAsync_block_invoke (in DVTFoundation)
 21   _dispatch_call_block_and_release (in libdispatch.dylib)
 22   _dispatch_client_callout (in libdispatch.dylib)
 23   _dispatch_lane_serial_drain (in libdispatch.dylib)
 24   _dispatch_lane_invoke (in libdispatch.dylib)
 25   _dispatch_workloop_worker_thread (in libdispatch.dylib)
 26   _pthread_wqthread (in libsystem_pthread.dylib)
 27   start_wqthread (in libsystem_pthread.dylib)
like image 500
Scott McCoy Avatar asked Sep 24 '19 00:09

Scott McCoy


People also ask

Does Xcode run tests in parallel?

Xcode 12 introduces another great way to speed things up: Parallel distributed testing. Parallel distributed testing involves running a test plan on multiple devices in parallel. Once a specific device finishes running a test, Xcode gives it a new test until there aren't any tests left.

Which framework is used to write unit test cases in Xcode?

Use the XCTest framework to write unit tests for your Xcode projects that integrate seamlessly with Xcode's testing workflow.

How do I add unit tests to an existing Xcode project?

To add a unit test target to an existing Xcode project, choose File > New > Target. Select your app platform (iOS, macOS, watchOS, tvOS) from the top of the New Target Assistant. Select the Unit Testing Bundle target from the list of targets.

How do I run unit test in Xcode?

Adding a unit test in Xcode Go to File > New > Target. Select iOS Unit Testing Bundle and then click Next. When you create a new Unit Test target for your project, it consists of a template class.


1 Answers

The error code appears to be referencing the lack of a parent process, denoted by the question marks and the either return code [1] or that that PID is responsible for that function. Is there possibly a problem with DVTFramework? If the problem persists, I recommend contacting Apple.

Edit

Yes there appears to be a problem with DVT as shown by the error hint:

Method:   -_internalSetState:result:error:
Thread:   <NSThread: 0x7fc17336ae40>{number = 81, name = (null)}
Hints:   

Backtrace:
  0   -[IDEAssertionHandler handleFailureInMethod:object:fileName:lineNumber:assertionSignature:messageFormat:arguments:] (in IDEKit)
  1   _DVTAssertionHandler (in DVTFoundation)
  2   _DVTAssertionFailureHandler (in DVTFoundation)
  3   -[DVTFuture _internalSetState:result:error:] (in DVTFoundation)
  4   __35-[DVTFuture setState:result:error:]_block_invoke (in DVTFoundation)
  5   invocation function for block in decltype(fp0()) DVTDispatchLockPerformLockedWriterBlock<void () block_pointer () block_pointer __strong>(DVTDispatchLock*, void () block_pointer () block_pointer __strong) (in DVTFoundation)
  6   _dispatch_client_callout (in libdispatch.dylib)
  7   _dispatch_lane_barrier_sync_invoke_and_complete (in libdispatch.dylib)
  8   DVTDispatchBarrierSync (in DVTFoundation)
  9   -[DVTDispatchLock performLockedBlock:] (in DVTFoundation)
 10   decltype(fp0()) DVTDispatchLockPerformLockedWriterBlock<void () block_pointer () block_pointer __strong>(DVTDispatchLock*, void () block_pointer () block_pointer __strong) (in DVTFoundation)
 11   -[DVTFuture setState:result:error:] (in DVTFoundation)
 12   -[DVTFuture failWithError:] (in DVTFoundation)
 13   __68-[DVTiPhoneSimulator launchSimulatedExecutable:launchService:error:]_block_invoke (in IDEiOSSupportCore)
 14   -[DVTFuture initWithBlock:] (in DVTFoundation)
 15   +[DVTFuture futureWithBlock:] (in DVTFoundation)
 16   -[DVTiPhoneSimulator launchSimulatedExecutable:launchService:error:] (in IDEiOSSupportCore)
 17   __55-[IDELaunchiPhoneSimulatorLauncher performWorkerAction]_block_invoke (in IDEiOSSupportCore)
 18   __43-[DVTDispatchLock asyncPerformLockedBlock:]_block_invoke (in DVTFoundation)
 19   __DVT_CALLING_CLIENT_BLOCK__ (in DVTFoundation)
 20   __DVTDispatchBarrierAsync_block_invoke (in DVTFoundation)
 21   _dispatch_call_block_and_release (in libdispatch.dylib)
 22   _dispatch_client_callout (in libdispatch.dylib)
 23   _dispatch_lane_serial_drain (in libdispatch.dylib)
 24   _dispatch_lane_invoke (in libdispatch.dylib)
 25   _dispatch_workloop_worker_thread (in libdispatch.dylib)
 26   _pthread_wqthread (in libsystem_pthread.dylib)
 27   start_wqthread (in libsystem_pthread.dylib)```
like image 143
Vendetta Avatar answered Oct 03 '22 23:10

Vendetta