Skip to content

toEventually hangs forever when using SPM #708

Description

@tomquist
  • 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()

func resolveResult(_ result: AwaitResult<T>) -> Bool {
if signal.wait(timeout: .now()) == .success {
self.asyncResult = result
return true
} else {
return false
}
}

however, the code seems to never be executed. I also set a breakpoint here
if promise.resolveResult(.completed(result)) {
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions