Skip to content

NSInternalInconsistencyException on failing expectations #276

Description

@atillman

Environment
XCode Version 7.3 (7D175)
Nimble, Master
Platform iOS
Unit Testing bundle
Cocoapods 0.39.0

Running a test in a Quick spec my passing specs run fine. The failing tests are throwing an error when reporting the error to XCTest. I can work around it's reported as a failure but the error is always reported as 'caught "NSInternalInconsistencyException", "Attempted to report a test failure to XCTest while no test case was running.' I can dig into the reported error and see the failure that caused the error but that is a pain.

Here is the full error and stacktrace I am getting:

file:///Users/antillman/Projects/PQ/mobile/ios/PrettyQuickTests/Specs/Extensions/CoreLocation/CLLocationCoordinate2D+PQExtensionsSpec.swift: test failure: -[CLLocationCoordinate2D_PQExtensionsSpec Equatable__returns_true_of_both_the_latitude_and_longitude_are_the_same()] failed: failed: caught "NSInternalInconsistencyException", "Attempted to report a test failure to XCTest while no test case was running. The failure was:
"expected to equal <CLLocationCoordinate2D(latitude: 41.889699999999998, longitude: -87.625)>, got <CLLocationCoordinate2D(latitude: 41.889699999999998, longitude: -87.625)>
"
It occurred at: /Users/antillman/Projects/PQ/mobile/ios/PrettyQuickTests/Specs/Extensions/CoreLocation/CLLocationCoordinate2D+PQExtensionsSpec.swift:39"
(
    0   CoreFoundation                      0x00000001122e4d85 __exceptionPreprocess + 165
    1   libobjc.A.dylib                     0x0000000111d58deb objc_exception_throw + 48
    2   CoreFoundation                      0x00000001122e49c9 -[NSException raise] + 9
    3   Nimble                              0x00000001209a9104 _TTSf4gs_g___TF6NimbleP33_3F48DF7243EE4E52B06D6D1EA023E49113recordFailureFTSS8locationCS_14SourceLocation_T_ + 1252
    4   Nimble                              0x00000001209a9399 _TTSf4n_g_g_d___TFC6Nimble19NimbleXCTestHandler6assertfTSb7messageCS_14FailureMessage8locationCS_14SourceLocation_T_ + 617
    5   Nimble                              0x00000001209a855e _TTWC6Nimble19NimbleXCTestHandlerS_16AssertionHandlerS_FS1_6assertfTSb7messageCS_14FailureMessage8locationCS_14SourceLocation_T_ + 94
    6   Nimble                              0x000000012099ee70 _TFV6Nimble11Expectation6verifyfTSbCS_14FailureMessage_T_ + 128
    7   Nimble                              0x000000012099f03c _TFV6Nimble11Expectation2touRd__S_7Matcherxzwd__9ValueTyperfTqd__11descriptionGSqSS__T_ + 364
    8   Nimble                              0x000000012098e5e1 _TZF6Nimbleoi2eeuRxs9EquatablerFTGVS_11Expectationx_GSqx__T_ + 241
    9   PrettyQuickTests                    0x00000001202ff225 _TFFFC16PrettyQuickTests39CLLocationCoordinate2D_PQExtensionsSpec4specFT_T_U0_FT_T_U2_FT_T_ + 581
    10  Quick                               0x0000000120b23c44 _TPA__TTRXFdCb__dT__XFo__dT__ + 36
    11  Quick                               0x0000000120b16fd3 _TFC5Quick7Example3runfT_T_ + 419
    12  Quick                               0x0000000120b17156 _TToFC5Quick7Example3runfT_T_ + 22
    13  Quick                               0x0000000120b11ad0 __60+[QuickSpec addInstanceMethodForExample:classSelectorNames:]_block_invoke + 80
    14  CoreFoundation                      0x00000001121cd5cc __invoking___ + 140
    15  CoreFoundation                      0x00000001121cd41e -[NSInvocation invoke] + 286
    16  XCTest                              0x000000011f80eef3 __24-[XCTestCase invokeTest]_block_invoke_2 + 362
    17  XCTest                              0x000000011f843613 -[XCTestContext performInScope:] + 190
    18  XCTest                              0x000000011f80ed78 -[XCTestCase invokeTest] + 169
    19  XCTest                              0x000000011f80f3a2 -[XCTestCase performTest:] + 459
    20  XCTest                              0x000000011f80ccf7 -[XCTestSuite performTest:] + 396
    21  XCTest                              0x000000011f80ccf7 -[XCTestSuite performTest:] + 396
    22  XCTest                              0x000000011f80ccf7 -[XCTestSuite performTest:] + 396
    23  XCTest                              0x000000011f7f9b10 __25-[XCTestDriver _runSuite]_block_invoke + 51
    24  XCTest                              0x000000011f81ab4c -[XCTestObservationCenter _observeTestExecutionForBlock:] + 640
    25  XCTest                              0x000000011f7f9a55 -[XCTestDriver _runSuite] + 453
    26  XCTest                              0x000000011f7fa7d1 -[XCTestDriver _checkForTestManager] + 259
    27  XCTest                              0x000000011f844a9a _XCTestMain + 628
    28  CoreFoundation                      0x000000011220a2ec __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
    29  CoreFoundation                      0x00000001121fff75 __CFRunLoopDoBlocks + 341
    30  CoreFoundation                      0x00000001121ff6d2 __CFRunLoopRun + 850
    31  CoreFoundation                      0x00000001121ff0f8 CFRunLoopRunSpecific + 488
    32  GraphicsServices                    0x0000000114ca6ad2 GSEventRunModal + 161
    33  UIKit                               0x000000010f382f09 UIApplicationMain + 171
    34  PrettyQuick                         0x000000010c5267bf main + 111
    35  libdyld.dylib                       0x0000000112d5b92d start + 1
)


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions