Unit test failing on Xcode 14.1

I am unable to run Unit Test targets for any project on my xcode 14.1 with iOS Simulator version 13.7

Assertions: System: Failed to install or launch the test runner.

Underlying Error: Process spawn via launchd failed. Bad file descriptor. (Underlying Error: The operation couldn’t be completed. (Mach error 9 - (os/kern) memory failure))

Details

Process spawn via launchd failed.
Domain: NSPOSIXErrorDomain
Code: 9
Failure Reason: Bad file descriptor
User Info: {
    DVTErrorCreationDateKey = "2023-04-26 21:17:18 +0000";
    IDERunOperationFailingWorker = IDELaunchiPhoneSimulatorLauncher;
    Session = "com.apple.CoreSimulator.SimDevice.32CA512F-AF12-4E75-B34C-D43C9AB75CDE";
}
--
The operation couldn’t be completed. (Mach error 9 - (os/kern) memory failure)
Domain: NSMachErrorDomain
Code: 9
--

Analytics Event: com.apple.dt.IDERunOperationWorkerFinished : {
    "device_model" = "iPhone12,5";
    "device_osBuild" = "13.7 (17H22)";
    "device_platform" = "com.apple.platform.iphonesimulator";
    "launchSession_schemeCommand" = Test;
    "launchSession_state" = 1;
    "launchSession_targetArch" = "x86_64";
    "operation_duration_ms" = 59;
    "operation_errorCode" = 9;
    "operation_errorDomain" = NSPOSIXErrorDomain;
    "operation_errorWorker" = IDELaunchiPhoneSimulatorLauncher;
    "operation_name" = IDERunOperationWorkerGroup;
    "param_consoleMode" = 0;
    "param_debugger_attachToExtensions" = 0;
    "param_debugger_attachToXPC" = 1;
    "param_debugger_type" = 3;
    "param_destination_isProxy" = 0;
    "param_destination_platform" = "com.apple.platform.iphonesimulator";
    "param_diag_MainThreadChecker_stopOnIssue" = 0;
    "param_diag_MallocStackLogging_enableDuringAttach" = 0;
    "param_diag_MallocStackLogging_enableForXPC" = 0;
    "param_diag_allowLocationSimulation" = 1;
    "param_diag_checker_tpc_enable" = 0;
    "param_diag_gpu_frameCapture_enable" = 3;
    "param_diag_gpu_shaderValidation_enable" = 0;
    "param_diag_gpu_validation_enable" = 1;
    "param_diag_memoryGraphOnResourceException" = 0;
    "param_diag_queueDebugging_enable" = 1;
    "param_diag_runtimeProfile_generate" = 0;
    "param_diag_sanitizer_asan_enable" = 0;
    "param_diag_sanitizer_tsan_enable" = 0;
    "param_diag_sanitizer_tsan_stopOnIssue" = 0;
    "param_diag_sanitizer_ubsan_stopOnIssue" = 0;
    "param_diag_showNonLocalizedStrings" = 0;
    "param_diag_viewDebugging_enabled" = 1;
    "param_diag_viewDebugging_insertDylibOnLaunch" = 0;
    "param_install_style" = 0;
    "param_launcher_UID" = 2;
    "param_launcher_allowDeviceSensorReplayData" = 0;
    "param_launcher_kind" = 0;
    "param_launcher_style" = 0;
    "param_launcher_substyle" = 0;
    "param_runnable_appExtensionHostRunMode" = 0;
    "param_runnable_productType" = "com.apple.product-type.tool";
    "param_runnable_type" = 1;
    "param_testing_launchedForTesting" = 1;
    "param_testing_suppressSimulatorApp" = 0;
    "param_testing_usingCLI" = 0;
    "sdk_canonicalName" = "iphonesimulator16.1";
    "sdk_osVersion" = "16.1";
    "sdk_variant" = iphonesimulator;
}
--


System Information

macOS Version 13.3.1 (Build 22E261)
Xcode 14.1 (21534.1) (Build 14B47b)
Timestamp: 2023-04-26T23:17:18+02:00

Yes, I am having the same problem.

I am able to run unit tests fine on macOS 12.5.1 but getting this error on other machine after upgrading to macOS 13.4.

Xcode 14.1 iPhone 11 iOS 13.7 simulator

Unit test failing on Xcode 14.1
 
 
Q