Test fails: "expected to eventually be true, got <true>"

Open
#360 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
ios, swift

Research direction

Start by reproducing the intermittent failure with expect(myFunc()).toEventually(beTrue(), timeout: myTimeout) in the stated iOS UI Testing environment, including the beTruthy() variant. The fix is complete when expectations that become true no longer fail intermittently and the behavior is covered by a reproducible test.

Written by the indexing model from the issue text.

Description

bug help wanted question / needs more details tricky

Nimble: 5.1.0, xcode: 8.0 (8A218a), using cocoapods, UI Testing bundle, iOS simulator (iPad 2 Air)

I really like Nimble, thanks!

Observed behaviour:
Tests sometimes fail with the following message: "expected to eventually be true, got ". When rerunning the same test it often just passes.

Expected behaviour:
When expectations gets true using the matcher beTrue() it should not fail.

Steps to reproduce:

  • I haven't been able to consistently reproduce. The same tests sometimes fail with this message and sometimes don't. It happens in different test classes.
  • The code is always of the following form:
    expect(myFunc()).toEventually(beTrue(), timeout: myTimeout) where myFunc() is in a different helper class.
  • The same happens with the beTruthy() matcher.

Screenshot from Xcode
screenshot 2016-11-02 20 01 01

Dominant language
Swift
Stars
4.8k
Forks
609
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Quick/Nimble

All issues in Quick/Nimble

Similar issues

More Swift issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.