You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have read CONTRIBUTING and have done my best to follow them.
What did you do?
If a QuickConfiguration contains a call to waitUntil, it will always timeout when running an AsyncSpec. In our case, we're using beforeSuite and afterSuite to call asynchronous methods to save and restore the values in the keychain to avoid
Below is the simplest way I could find to reproduce it. The test will always fail with the message
classAsyncConfiguration:QuickConfiguration{overrideclassfunc configure(_ configuration:QCKConfiguration){
configuration.beforeSuite{waitUntil{ done indone()}}}}classAsyncConfigurationSpec:AsyncSpec{overrideclassfunc spec(){it("should be called"){}}}
What did you expect to happen?
waitUntil doesn't timeout when the test is a subclass of QuickSpec.
What actually happened instead?
The closure passed to waitUntil is never called. Neither a breakpoint or a print are called until after waitUntil has timed out.
Increasing the timeout interval has no affect. The test will always wait the full timeout before failing.
The test failed with the following message.
should be called(): Waited more than 1.0 second
Environment
List the software versions you're using:
Quick: 7.4.0
Nimble: 13.2.0
Xcode Version: 15.2
Swift Version: 5.9
Please also mention which package manager you used and its version. Delete the
other package managers in this list:
Swift Package Manager - Swift 5.9.0
Project that demonstrates the issue
I reproduced it with the Quick repo, since I wasn't sure which repo was the cause of the issue.
Yeah. This is unsurprising, but still disappointing. It's also a bug with Quick, not Nimble - you'd get similar behavior if you tried the following code:
classAsyncConfiguration:QuickConfiguration{overrideclassfunc configuration(_ configuration:QCKConfiguration){
configuration.beforeEach{letstart=Date()RunLoop.main.run(until:Date(timeIntervalSinceNow:2))expect(date.timeIntervalSince(start)).to(beCloseTo(2, within: 0.01)) // this assertion will fail when run with an async spec.
}}}
AsyncExample will run the stuff in your QuickConfiguration, as a matter of fact. This is desired because using any kind of waiting behavior in that kind of global configuration is an edge case (QuickConfiguration is meant more for doing stuff like configuring your test suite, not waiting for stuff to be available).
This is an issue when you try to run the sync versions of waitUntil, toEventually, etc. because those use APIs which no-op when run in an async context.
What did you do?
If a
QuickConfiguration
contains a call towaitUntil
, it will always timeout when running anAsyncSpec
. In our case, we're using beforeSuite and afterSuite to call asynchronous methods to save and restore the values in the keychain to avoidBelow is the simplest way I could find to reproduce it. The test will always fail with the message
What did you expect to happen?
waitUntil
doesn't timeout when the test is a subclass ofQuickSpec
.What actually happened instead?
The closure passed to
waitUntil
is never called. Neither a breakpoint or a print are called until afterwaitUntil
has timed out.Increasing the timeout interval has no affect. The test will always wait the full timeout before failing.
The test failed with the following message.
Environment
List the software versions you're using:
Please also mention which package manager you used and its version. Delete the
other package managers in this list:
Project that demonstrates the issue
I reproduced it with the Quick repo, since I wasn't sure which repo was the cause of the issue.
pbpaste | git apply
The text was updated successfully, but these errors were encountered: