Nimble: toEventually hangs forever when using SPM

  • I have read CONTRIBUTING and have done my best to follow them.

What did you do?

I switched from Carthage to Swift Package Manager for integrating Quick and Nimble into a project. My tests use toEventually() in some places.

What did you expect to happen?

toEventually() should either finish or timeout eventually.

What actually happened instead?

toEventually() never stops, it polls forever and doesn’t even timeout. I tried to debug the issue by setting a breakpoint in AwaitPromise.resolveResult() https://github.com/Quick/Nimble/blob/9a4564effa6607cd571adbccf990bb0e6f8558db/Sources/Nimble/Utils/Await.swift#L118-L125 however, the code seems to never be executed. I also set a breakpoint here https://github.com/Quick/Nimble/blob/9a4564effa6607cd571adbccf990bb0e6f8558db/Sources/Nimble/Utils/Await.swift#L330 and observed that the line is called which is really strange.

When executing tests in Release configuration everything works as expected so I assume this is a compiler bug.

Environment

List the software versions you’re using:

  • Quick: 2.2.0
  • Nimble: 8.0.4
  • Xcode Version: 11.2 (11B52) (Open Xcode; In menubar: Xcode > About Xcode)
  • Swift Version: 5.1.2 (Xcode Default) (Open Xcode Preferences; Components > Toolchains. If none, use Xcode Default.)

Please also mention which package manager you used and its version. Delete the other package managers in this list:

Swift Package Manager 5.1.0 (swiftpm-15502) (Use swift build --version in Terminal)

Project that demonstrates the issue

https://github.com/tomquist/NimbleStallBug

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 3
  • Comments: 16 (14 by maintainers)

Commits related to this issue

Most upvoted comments

I already have dead code stripping disabled for my framework and test target, and it hangs.

After more experimentation, setting DEAD_CODE_STRIPPING = NO fixed the issue, so I think the root cause is the compiler bug SR-11564. I guess disabling dead code stripping is the workaround until this is fixed.

I am seeing this same issue using SPM and only on Xcode 11.2. Prior to updating to 11.2 there was no issues, which makes me think @tomquist may be right about this being a compiler bug.

Yes, me mentioning that it works in release configuration was not meant as a solution but more of an information to be able to track down the issue. I’d also try to fix it myself but I don’t really know where to start here and currently don’t have the time to further investigate so would be happy if somebody could look into this in more detail.