zalando / SwiftMonkey

A framework for doing randomised UI testing of iOS apps
MIT License
1.95k stars 174 forks source link

Fail when start commandLine with DragAction #19

Closed AymenFarrah closed 5 years ago

AymenFarrah commented 7 years ago

We have a problem when we launch MonkeyTest from command line (it works with Xcode but fail with xcodebuild)

we have this logs to help you : t = 8.22s Tear Down 11:15:46.041 xcodebuild[32562:183033] _XCT_testCaseDidFailForTestClass:TestsUI.MonkeyTest method:testMonkey withMessage:failed: caught "NSInvalidArgumentException", "*** -[NSXPCEncoder _checkObject:]: This coder only encodes objects that adopt NSSecureCoding (object is of class 'NSMallocBlock')."

19 XCTest 0x0020341b -[XCEventGenerator pressAtPoint:forDuration:liftAtPoint:velocity:orientation:name:handler:] + 560 20 SwiftMonkey 0x0eb6cdf5 _TFFC11SwiftMonkey6Monkey19addXCTestDragActionFT6weightSd_T_U_FTT + 1157 21 SwiftMonkey 0x0eb63e89 _TTRXFo_XFo_iTiT + 25 22 SwiftMonkey 0x0eb63f4f _TPA_TTRXFoXFo_iTiT + 95 23 SwiftMonkey 0x0eb63715 _TTRXFo_iTiTXFo_ + 21 24 SwiftMonkey 0x0eb637fd _TPATTRXFo_iTiTXFo___ + 61 25 SwiftMonkey 0x0eb63570 _TFC11SwiftMonkey6Monkey11actRandomlyfTT + 640 26 SwiftMonkey 0x0eb632df _TFC11SwiftMonkey6Monkey12monkeyAroundfTT + 31

When i remove addXCTestDragAction from addDefaultXCTestPrivateActions() it works

DagAgren commented 7 years ago

Hmm, mysterious. I have not attempted to use it that way, and it seems to be crashing inside the private XCTest event generation code. Is it somehow exiting before an long press is done, maybe?

YanSte commented 7 years ago

@DagAgren Same error

YanSte commented 7 years ago

test failure: -[MonkeyUITests testMonkey()] failed: failed: caught "NSInvalidArgumentException", "*** -[NSXPCEncoder _checkObject:]: This coder only encodes objects that adopt NSSecureCoding (object is of class 'NSMallocBlock')." ( 0 CoreFoundation 0x00bc7a94 exceptionPreprocess + 180 1 libobjc.A.dylib 0x00688e02 objc_exception_throw + 50 2 CoreFoundation 0x00bc79bd +[NSException raise:format:] + 141 3 Foundation 0x002c76fc -[NSXPCEncoder _checkObject:] + 366 4 Foundation 0x002c7334 -[NSXPCEncoder encodeObject:forKey:] + 67 5 XCTest 0x00155938 -[XCSynthesizedEventRecord encodeWithCoder:] + 49 6 Foundation 0x002c7c8b -[NSXPCEncoder _encodeObject:] + 665 7 Foundation 0x002c7378 -[NSXPCEncoder encodeObject:forKey:] + 135 8 Foundation 0x002c8068 -[NSXPCEncoder encodeObject:] + 48 9 Foundation 0x002bd203 _walkAndEncodeData + 1303 10 Foundation 0x002bcb36 encodeInvocationArguments + 298 11 Foundation 0x002c7e4e -[NSXPCEncoder encodeInvocation:] + 406 12 Foundation 0x002c7c8b -[NSXPCEncoder _encodeObject:] + 665 13 Foundation 0x002c7378 -[NSXPCEncoder encodeObject:forKey:] + 135 14 Foundation 0x004667cf -[NSXPCConnection _sendInvocation:withProxy:remoteInterface:withErrorHandler:timeout:userInfo:] + 3322 15 Foundation 0x00465a13 -[NSXPCConnection _sendInvocation:withProxy:remoteInterface:] + 88 16 Foundation 0x002c6ca1 -[NSXPCDistantObject forwardInvocation:] + 97 17 CoreFoundation 0x00b0ec08 forwarding_ + 472 18 CoreFoundation 0x00b0ea0e _CF_forwarding_prep_0 + 14 19 XCTest 0x0016541b -[XCEventGenerator pressAtPoint:forDuration:liftAtPoint:velocity:orientation:name:handler:] + 560 20 SwiftMonkey 0x0c006f93 _TFFC11SwiftMonkey6Monkey19addXCTestDragActionFT6weightSd_T_U_FTT + 1187 21 SwiftMonkey 0x0bffd739 _TTRXFo___XFo_iTiT + 25 22 SwiftMonkey 0x0bffd7ff _TPA_TTRXFoXFo_iTiT + 95 23 SwiftMonkey 0x0bffcf05 _TTRXFo_iTiTXFo_ + 21 24 SwiftMonkey 0x0bffcfed _TPATTRXFo_iTiTXFo_ + 61 25 SwiftMonkey 0x0bffcd60 _TFC11SwiftMonkey6Monkey11actRandomlyfTT + 736 26 SwiftMonkey 0x0bffc9df _TFC11SwiftMonkey6Monkey12monkeyAroundfT10iterationsSiT + 335 27 OpenFleetUITests 0x0bf899a1 _TFC16OpenFleetUITests13MonkeyUITests10testMonkeyfTT + 1409 28 OpenFleetUITests 0x0bf89a32 _TToFC16OpenFleetUITests13MonkeyUITests10testMonkeyfTT + 34 29 CoreFoundation 0x00a9fccd _invoking + 29 30 CoreFoundation 0x00a9fb76 -[NSInvocation invoke] + 342 31 XCTest 0x0015b4d7 24-[XCTestCase invokeTest]_block_invoke_2 + 470 32 XCTest 0x00196dab -[XCTestContext performInScope:] + 229 33 XCTest 0x0015b2f4 -[XCTestCase invokeTest] + 269 34 XCTest 0x0015bbec -[XCTestCase performTest:] + 515 35 XCTest 0x00186a4f -[XCTest runTest] + 48 36 XCTest 0x00158936 -[XCTestSuite performTest:] + 488 37 XCTest 0x00186a4f -[XCTest runTest] + 48 38 XCTest 0x00158936 -[XCTestSuite performTest:] + 488 39 XCTest 0x00186a4f -[XCTest runTest] + 48 40 XCTest 0x00158936 -[XCTestSuite performTest:] + 488 41 XCTest 0x00186a4f -[XCTest runTest] + 48 42 XCTest 0x0014322d __25-[XCTestDriver _runSuite]_block_invoke + 61 43 XCTest 0x0016755b -[XCTestObservationCenter _observeTestExecutionForBlock:] + 663 44 XCTest 0x00143090 -[XCTestDriver _runSuite] + 510 45 XCTest 0x00144118 -[XCTestDriver _checkForTestManager] + 290 46 XCTest 0x00144518 -[XCTestDriver runTestConfiguration:completionHandler:] + 325 47 XCTest 0x0019834b _XCTestMain + 642 48 XCTRunner 0x00050b58 XCTRunner + 7000 49 CoreFoundation 0x00ae1e60 CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK + 16 50 CoreFoundation 0x00ad77e3 CFRunLoopDoBlocks + 195 51 CoreFoundation 0x00ad6f18 __CFRunLoopRun + 1016 52 CoreFoundation 0x00ad6866 CFRunLoopRunSpecific + 470 53 CoreFoundation 0x00ad667b CFRunLoopRunInMode + 123 54 GraphicsServices 0x0262f664 GSEventRunModal + 192 55 GraphicsServices 0x0262f4a1 GSEventRun + 104 56 UIKit 0x00f56cc1 UIApplicationMain + 160 57 XCTRunner 0x00050cce XCTRunner + 7374 58 libdyld.dylib 0x02ddaa21 start + 1 )

wojciechczerski commented 5 years ago

Closing due to inactivity. Please reopen the issue if you think it should be addressed.