Comments (5)
@bredfield did you find fix for your issues. I am also experiencing similar issues.
from nocilla.
@subbarao I haven't been able to get stable results with Nocilla. I've been using Mockingjay, which has worked well.
from nocilla.
Hi @bredfield,
TL;DR: This is probably caused by the exception thrown here. When this gets thrown, subsequent requests in the same test run to correctly stubbed URLs seem to fail.
I'm working in Objective-C, but I've run into a similar issue. Since you've changed test suites, this probably isn't a big deal for you, but I'll leave this post here for anybody else who is seeing inconsistent results during test runs.
In my case, our class under test is using NSURLConnection with delegate callbacks directed to an NSOperationQueue.
As described in issue #103, the exception thrown at https://github.com/luisobo/Nocilla/blob/master/Nocilla/LSNocilla.m#L79 basically wrecks all of the tests that run after the exception is thrown.
In Xcode, the tests seem to run in alphabetical order of the test method names--Depending on the order of tests your XCTest class implementation, this could make things appear to be "randomly" failing. (For fun, reorder the test methods in your file alphabetically, and see if a more clear failure pattern appears).
In our case, the test that caused the exception was intentionally hitting a non-stubbed URL in order to test behavior with non-responsive requests. By design, this test succeeded after checking some queuing behaviors related to a bunch of open requests (to non-stubbed URLs). Inside Nocilla, of course, this throws an exception that we never see, and subsequent tests with correctly stubbed requests fail.
The result, of course, is that if you run each of the tests individually, they pass. If you run them all together, the non-stubbed request in the middle of the test run breaks every subsequent test.
You can detect this condition by setting an exception breakpoint. If you try this and it breaks into LSNocilla.m during the test run, you've sent a request to a non-stubbed URL.
Good Luck,
Paul B. Davis
from nocilla.
Hi guys,
has anyone resolved this issue ?
from nocilla.
As @paudav mention above it was connected with exception raising. There is an pull request. Error is returned instead of raising an exception
from nocilla.
Related Issues (20)
- Not able to stub cookies for normal (non-directed requests) HOT 1
- Body matcher fails to match arbitrary NSData
- Support for RestKit HOT 1
- Add 0.10.0 to CocoaPods.org HOT 1
- Synchronous Request Support
- Wait for async request to complete before stop() HOT 1
- Crash in LSHTTPStubURLProtocol - EXC_BAD_ACCESS - Specific way to stub redirects? HOT 1
- Ability to Delay a Response HOT 1
- Redirect Implementation is Inconsistent With OS Behavior
- Carthage Binaries HOT 1
- ASIHTTPRequest synchronous request with stub never ends HOT 1
- LSNocilla.sharedInstance().stop() Not working HOT 5
- Project no longer maintained? HOT 3
- Nocilla never returns the stub HOT 2
- App store rejection due to private api references HOT 3
- Use this snippet to stub the request HOT 1
- Push v0.11.0 podspec to Cocoapods HOT 2
- Swift 3 Support HOT 2
- How do I Nocilla in Swift 3? HOT 2
- SPM Support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nocilla.