GithubHelp home page GithubHelp logo

Comments (5)

subbarao avatar subbarao commented on July 17, 2024

@bredfield did you find fix for your issues. I am also experiencing similar issues.

from nocilla.

bredfield avatar bredfield commented on July 17, 2024

@subbarao I haven't been able to get stable results with Nocilla. I've been using Mockingjay, which has worked well.

from nocilla.

paudav avatar paudav commented on July 17, 2024

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.

TheAdamBorek avatar TheAdamBorek commented on July 17, 2024

Hi guys,
has anyone resolved this issue ?

from nocilla.

TheAdamBorek avatar TheAdamBorek commented on July 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.