Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spurious failure: Nested async expectations are not allowed to avoid creating flaky tests #1026

Open
1 task done
xinsight opened this issue Dec 8, 2022 · 0 comments
Open
1 task done

Comments

@xinsight
Copy link

xinsight commented Dec 8, 2022

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

What did you do?

I ran a test that has passed many times in the past, but is now failing.

class ExportDataActionSpec: QuickSpec {
    override func spec() {
        describe("ExportDataAction") {
            it("should do something") {
                let viewController = UIViewControllerMock()
                let session = MockNetworkSession.session
                let action = ExportDataAction(viewController: viewController, session: session)
                action.execute()
                expect(viewController.viewControllerFromPresentCall).toEventually(beAKindOf(UIActivityViewController.self), timeout: .seconds(3))
            }
        }
    }
}

What did you expect to happen?

I expect the test to pass.

The test always passes locally, but only seems to fail when running in CI. (github action)

What actually happened instead?

The test failed with:

Nested async expectations are not allowed to avoid creating flaky tests.

I don't understand this message as there are no nested async expectations. What am I missing?

Environment

List the software versions you're using:

  • Quick: 4.0.0
  • Nimble: 9.2.1 (also tried 11.2.1 and got the same error)
  • Xcode Version: 14.0 (14A309)
  • Swift Version: 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.7.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant