Xcode Test case running fail with Unexpected exception in Jenkins

I am getting the below exception in Jenkins on trying to execute the XC Test cases. When i try with terminal, it works just fine. Only with Jenkins it fails,
** INTERNAL ERROR: Uncaught exception while building **
[18:09:51]: ▸ Uncaught Exception: *** -[NSStdIOFileHandle writeData:]: Broken pipe
[18:09:51]: ▸ Stack:
[18:09:52]: ▸ 0 __exceptionPreprocess (in CoreFoundation)
[18:09:52]: ▸ 1 objc_exception_throw (in libobjc.A.dylib)
[18:09:52]: ▸ 2 +[NSException raise:format:] (in CoreFoundation)
[18:09:52]: ▸ 3 -[NSConcreteFileHandle writeData:] (in Foundation)
[18:09:52]: ▸ 4 IDETestingFileHandleOutputStream.write(
:slight_smile: (in IDEFoundation)
[18:09:52]: ▸ 5 @objc IDETestingFileHandleOutputStream.write(:slight_smile: (in IDEFoundation)
[18:09:52]: ▸ 6 specialized IDETestingMultiOutputStream.write(
:slight_smile: (in IDEFoundation)
[18:09:52]: ▸ 7 @objc IDETestingFileHandleOutputStream.write(_:slight_smile: (in IDEFoundation)
[18:09:52]: ▸ 8 specialized IDETestingLaunchSession.parseConsoleOutput(fromOriginalOutput:) (in IDEFoundation)
[18:09:52]: ▸ 9 @objc IDETestingLaunchSession.parseConsoleOutput(fromOriginalOutput:) (in IDEFoundation)
[18:09:52]: ▸ 10 -[IDEConsoleAdaptor _delegateProcessedOutput:] (in IDEFoundation)
[18:09:52]: ▸ 11 -[IDEConsoleAdaptor _getData:fileHandle:overflowBuffer:stringBuffer:] (in IDEFoundation)
[18:09:52]: ▸ 12 -[IDEConsoleAdaptor _getDataFromNotification:overflowBuffer:stringBuffer:] (in IDEFoundation)
[18:09:52]: ▸ 13 -[IDEConsoleAdaptor _getOutputFromNotification:] (in IDEFoundation)
[18:09:52]: ▸ 14 DVTInvokeWithLazyFailureHint (in DVTFoundation)
[18:09:52]: ▸ 15 -[_DVTNotificationReceiver receiveNotification:] (in DVTFoundation)
[18:09:52]: ▸ 16 CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER (in CoreFoundation)
[18:09:52]: ▸ 17 ___CFXRegistrationPost_block_invoke (in CoreFoundation)
[18:09:52]: ▸ 18 _CFXRegistrationPost (in CoreFoundation)
[18:09:52]: ▸ 19 ___CFXNotificationPost_block_invoke (in CoreFoundation)
[18:09:52]: ▸ 20 -[_CFXNotificationRegistrar find:object:observer:enumerator:] (in CoreFoundation)
[18:09:52]: ▸ 21 _CFXNotificationPost (in CoreFoundation)
[18:09:52]: ▸ 22 -[NSNotificationCenter postNotificationName:object:userInfo:] (in Foundation)
[18:09:52]: ▸ 23 -[IDEMasterPtyFileHandle _gotData:] (in IDEFoundation)
[18:09:52]: ▸ 24 CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER (in CoreFoundation)
[18:09:52]: ▸ 25 ___CFXRegistrationPost_block_invoke (in CoreFoundation)
[18:09:52]: ▸ 26 _CFXRegistrationPost (in CoreFoundation)
[18:09:52]: ▸ 27 ___CFXNotificationPost_block_invoke (in CoreFoundation)
[18:09:52]: ▸ 28 -[_CFXNotificationRegistrar find:object:observer:enumerator:] (in CoreFoundation)
[18:09:52]: ▸ 29 _CFXNotificationPost (in CoreFoundation)
[18:09:52]: ▸ 30 -[NSNotificationCenter postNotificationName:object:userInfo:] (in Foundation)
[18:09:52]: ▸ 31 _performFileHandleSource (in Foundation)
[18:09:52]: ▸ 32 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION (in CoreFoundation)
[18:09:52]: ▸ 33 __CFRunLoopDoSource0 (in CoreFoundation)
[18:09:52]: ▸ 34 __CFRunLoopDoSources0 (in CoreFoundation)
[18:09:52]: ▸ 35 __CFRunLoopRun (in CoreFoundation)
[18:09:52]: ▸ 36 CFRunLoopRunSpecific (in CoreFoundation)
[18:09:52]: ▸ 37 CFRunLoopRun (in CoreFoundation)
[18:09:52]: ▸ 38 -[Xcode3CommandLineBuildTool _buildWithTimingSection:] (in Xcode3Core)
[18:09:52]: ▸ 39 -[Xcode3CommandLineBuildTool run] (in Xcode3Core)
[18:09:52]: ▸ 40 main (in xcodebuild)
[18:09:52]: ▸ 41 start (in libdyld.dylib)

Hi
Which xcode version you are on currently?
I’ll suggest you to reinstall XCode.

Let me know after reinstalling it.