Nimble: Attempted to report a test failure to XCTest while no test case was running on 8.1.0

Created on 10 Jun 2020  路  12Comments  路  Source: Quick/Nimble

I've added 8.1.0 to a new project with just one test.
Running the test that is expected to fail produces caught "NSInternalInconsistencyException", "Attempted to report a test failure to XCTest while no test case was running.

I tried lowering versions of Nimble, the first one to correctly report test failure is 8.0.7

I'm on XCode 11.4.1

bug

Most helpful comment

@esteluk

I'm also seeing this (in a Swift/Obj-c iOS project), will see if I can make a reproducible issue.

Same problem here.

@ikesyo
And just tried #802, problem solved.

All 12 comments

It would be helpful if you could provide a reproducible project/repository.

I can't reproduce it. Please fill the issue template first.

It's a react native project with a whole bunch of dependencies. We plan on releasing it as open source soon. I'll close this for now and re-open once the repo is publicly available so you can reproduce.

I'm also seeing this (in a Swift/Obj-c iOS project), will see if I can make a reproducible issue.

I'm confident that this issue is related to https://github.com/Quick/Nimble/commit/28d79788ecd17ea6875dda56aba8df5c3ccd088e because I can pretty clearly see that the CurrentTestCaseTracker instance methods are never being fired, which results in error logging in recordFailure to fall through.

I'm pretty confident that this issue happens for users who are linking Nimble statically 馃憤 . I managed to fix it locally by changing to dynamic linking, but the __attribute__((constructor)) annotation means that registerCurrentTestCaseTracker is being optimised out by the linker.

I see the same problem in a project where the pods (including Nimble) are linked statically. Is there a way to re-open this ticket?

I experienced this just now, too, on v8.1.1. Nimble was added via CocoaPods and as @LarsPetersHH said, it was using static libs. The failure occurred on an async expectation, expect(foo).toEventuallyNot(beNil()).

Luckily, I had no reason for not using frameworks, adding use_frameworks! to the Podfile fixed it 馃憤

_My test's still failing, though, but that's got nothing to do with Nimble_ 馃槄

My project is in React Native and I'm also using static libs which seem to be the problem here.

Reopening

Sorry for the inconvenience, could you try #802?

@esteluk

I'm also seeing this (in a Swift/Obj-c iOS project), will see if I can make a reproducible issue.

Same problem here.

@ikesyo
And just tried #802, problem solved.

Sorry for the inconvenience, could you try #802?

Works for me too, thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ikesyo picture ikesyo  路  3Comments

pavel-primachek picture pavel-primachek  路  3Comments

msaehn picture msaehn  路  5Comments

Blackjacx picture Blackjacx  路  7Comments

hamchapman picture hamchapman  路  7Comments